Skip to content

SDKs

PackageDescriptionRepo
@authn-sh/sdk-jsVanilla TS client + state machines for sign-in / sign-up / sessions.authn-sh/javascript
@authn-sh/sdk-reactReact provider + drop-in components (<SignIn />, <UserButton />, …).authn-sh/javascript
@authn-sh/uiDesign primitives (Button, Input, Avatar, …) shared between SDK surfaces.authn-sh/javascript
PackageDescriptionRepo
authn-sh/sdk-phpPHP backend SDK + Laravel package, BAPI client, JWT + webhook verifiers.authn-sh/sdk-php

Other languages (Go, Python, Ruby) are on the v0.4+ roadmap. v0.1 ships JS + PHP.

@authn-sh/sdk-react gains:

  • <SocialButtons />, <PhoneNumberField />, <ConnectedAccountsPanel /> — see Connected-accounts components.
  • useExternalAccounts(), usePhoneNumbers() hooks.
  • User.createPhoneNumber(), User.getExternalAccounts() helpers.

@authn-sh/sdk-js gains:

  • SignIn.authenticateWithRedirect({ strategy, redirectUrl, redirectUrlComplete }) — drives the OAuth first-factor flow.
  • Authn.handleRedirectCallback() — completes the round-trip after the IdP bounces the browser back.
  • PhoneNumber and ExternalAccount resource classes with the toggle / verify / unlink helpers.

authn-sh/sdk-php gains:

  • OauthProvidersManager, PhoneNumbersManager, ExternalAccountsManager, SmsTemplatesManager BAPI clients.
  • VerifiedClaims->hasVerifiedPhoneNumber(), getDefaultSecondFactor(), hasMfa() — see JWT claims.

authn-sh/sdk-php-laravel gains:

  • @authnHasConnectedAccount('google') Blade directive.
  • RequiresConnectedAccount middleware.

The two extension points that don’t need an SDK: