Duffel.Identity.ComponentClientKeys (Duffel v0.1.0)

Copy Markdown View Source

Create short-lived keys for authenticating Duffel UI components in the browser.

Scope the key by passing user and/or resource IDs, so the component can only act on what you allow.

See the Duffel documentation.

Summary

Functions

Creates a component client key.

Functions

create(client, params \\ %{}, opts \\ [])

@spec create(Duffel.Client.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Duffel.Error.t()}

Creates a component client key.

Pass any of :user_id, :order_id, :booking_id or :offer_request_id in params to scope the key; omit params for an unscoped key.

Examples

Duffel.Identity.ComponentClientKeys.create(client, %{order_id: "ord_123"})