Clerk.Config (Clerk SDK v2.0.0)
Configuration for a Clerk tenant connection.
Build a config with new/1, start the supervisor with {Clerk, config}, and
pass the same struct to API calls and plugs via the config: option.
Examples
config =
Clerk.Config.new(
name: AppA.Clerk,
domain: "app-a.clerk.accounts.dev",
secret_key: System.fetch_env!("APP_A_CLERK_SECRET_KEY"),
fetching_strategy: AppA.Clerk.FetchingStrategy
)
children = [{Clerk, config}]
Clerk.User.list(%{}, config: config)
Summary
Types
Functions
Link to this function
default()
Returns the default config built from config :clerk application config.
Equivalent to passing Application.get_all_env(:clerk) to {Clerk, ...}.
Used automatically when API calls omit config:.
Link to this function
new(opts)
Builds a %Clerk.Config{} from keyword options.
Required:
:domain- the Clerk Frontend API domain (e.g."app.clerk.accounts.dev")
Optional:
:name- supervisor and process name. Defaults toClerk.:secret_key- Backend API secret key.:authorized_parties- allowlist for JWTazpclaim validation.:fetching_strategy- JWKS fetching strategy module. Required when:nameis notClerk.:http_name- Finch pool name. Derived from:namewhen omitted.