@offline-protocol/id-react@0.2.0 for hosted email sign-in, profiles and connections. Create an application in the developer portal and configure its allowed web origins. The appId prop is the application’s public identifier, not a secret key. Origin checks are being rolled out; requests without an Origin header are not checked.
Add the provider and sign-in control
loginWithModal() opens the email authentication UI and returns void. Read user and loading to observe the result. Sign-in requires network access to the hosted service.
See OfflineID hooks for profile and connection APIs, or Mesh SDK identity for local device authentication.
Application attribution
For Next.js, use a public configuration value such asNEXT_PUBLIC_OFFLINE_APP_ID=app_your_application_id. Pass that value as appId.
Version 0.2.0 sends the App ID in x-app-id, and still sends the legacy x-project-id header with the same value. Sign-ins are attributed to the application for analytics, app membership and billing pauses. Direct HTTP integrations send X-App-Id explicitly.
Upgrade from 0.1.x
- Pass
appIdtoOfflineAppProviderand callsetAppId.projectIdandsetProjectIdstill work but are deprecated. verifyCoderesolves tonullwhen the code is wrong or expired, and throws for any other failure: a network error, a timeout, an invalid email, an origin the application does not allow, a server error or a rate limit. In 0.1.x it threw in both cases.useLocationis removed. Use@offline-protocol/polfor Proof of Location.addConnectionresolves to a connection in the same shape as each item inconnections, anduseConnections()addssetLocationSharing. See OfflineID hooks.- Requests time out after 15 seconds and fail like a network error. A write that timed out may still have reached the server, so retrying it can repeat it.
- The package is licensed under MIT (0.1.5 was published as ISC).

