A client preset for public (PKCE-only) applications — no API key required.
Exposes only the helper surface that is safe without a client secret: authorization URL builders with automatic PKCE.
public = WorkOS.PublicClient.new("client_123")
%{url: url, code_verifier: verifier} =
WorkOS.PublicClient.get_authorization_url(public, %{redirect_uri: "..."})Exchange the resulting code with WorkOS.AuthKit.pkce_code_exchange/3 or
WorkOS.SSO.PKCE.code_exchange/3 from your backend, or against the token
endpoint directly from the public client's environment.
Summary
Functions
Builds an AuthKit authorization URL with automatically generated PKCE
parameters and state. See WorkOS.AuthKit.get_pkce_authorization_url/2.
Builds an SSO authorization URL with automatically generated PKCE
parameters and state. See WorkOS.SSO.PKCE.get_authorization_url/2.
Builds a public client from a client ID. No API key is required.
Types
@type t() :: %WorkOS.PublicClient{client: WorkOS.Client.t()}
Functions
@spec get_authorization_url(t(), map()) :: WorkOS.AuthKit.pkce_authorization_url()
Builds an AuthKit authorization URL with automatically generated PKCE
parameters and state. See WorkOS.AuthKit.get_pkce_authorization_url/2.
@spec get_sso_authorization_url(t(), map()) :: WorkOS.AuthKit.pkce_authorization_url()
Builds an SSO authorization URL with automatically generated PKCE
parameters and state. See WorkOS.SSO.PKCE.get_authorization_url/2.
Builds a public client from a client ID. No API key is required.
Options
:base_url— override the API base URL