Block-Auth SDKs

Block-Auth has SDKs for both sides of your app: a login widget for your frontend and a client for your backend. Together they add passwordless login without your app ever trusting the browser.

Which SDK you need

WherePackageWhat you use in your code
React@block-auth.io/reactBlockAuthProvider, <FlowBlockAuth />, <LinkBlockAuth />, useBlockAuthUser()
Vue@block-auth.io/vuecreateBlockAuth(), <FlowBlockAuth />, <LinkBlockAuth />, useBlockAuthUser()
Angular@block-auth.io/angularprovideBlockAuth(), <ba-flow-block-auth>, <ba-link-block-auth>, BlockAuthService
Node.js@block-auth.io/nodeBlockAuthRoutes, blockauthRouter(), AuthCodeClient
PHPblockauth/sdkBlockAuthRoutes, AuthCodeClient
Pythonblockauth-sdkBlockAuthRoutes, blockauth_blueprint() (Flask), blockauth_router() (FastAPI), AuthCodeClient
.NETBlockAuth.Sdk.AspNetCoreAddBlockAuth(), MapBlockAuth(), AuthCodeClient
WordPressBlock-Auth Login pluginLogin button, account linking, users and roles

The three frontend packages share the same engine, @block-auth.io/core, and offer the same components. The backend packages give you BlockAuthRoutes, the routes the widget calls, ready to mount in your server, and AuthCodeClient for the redirect login. In .NET, BlockAuth.Sdk.AspNetCore brings BlockAuth.Sdk with it.

AuthCodeClient has the same methods in every language: authorize, exchangeCode, signOut, revokeLink and verifyWebhook (in Python, exchange_code, sign_out…; in .NET, ExchangeCodeAsync, SignOutAsync…).

Two ways to integrate

Both end the same way: your backend redeems a one-time code with your apiSecret and creates its own session.

  • Widget and your backend. The Block-Auth button lives in your frontend and opens the login in a popup; your backend redeems the code. Best for single-page apps in React, Vue or Angular. Follow the SDK Quickstart.
  • Redirect login. Your frontend only has a link; your backend redirects the user to Block-Auth and receives them back. Best for server-rendered apps. See PHP, Python, .NET, Node.js.

The rule that matters

  • The apiKey is public: it goes in your frontend.
  • The apiSecret is private: it stays in your backend, never in the browser.
  • Your backend only trusts the user it gets from POST /api/auth/token, never an address sent by the browser.

What's next?

  • SDK Quickstart: pick the guide for your stack and integrate from zero, step by step.
  • Customize the widget: every prop of the React, Vue and Angular components.
  • Roles: show or hide parts of your UI by role.