Follow these simple steps to set up Civic Auth with a Fastify backend.
secure: true
+ sameSite: "none"
for cross-origin compatibility. Without HTTPS, cross-origin cookies will not be saved by the browser.
@civic/auth/vanillajs
client with your backend:
Parameter | Required | Description |
---|---|---|
clientId | Yes | Client ID from auth.civic.com |
redirectUrl | Yes | OAuth callback URL where Civic redirects after authentication |
postLogoutRedirectUrl | No | Where to redirect users after logout |
loginSuccessUrl | No | Redirect Single Page Applications back to frontend after successful authentication |
oauthServer | No | OAuth server URL (useful for development/testing environments) |