> ## Documentation Index
> Fetch the complete documentation index at: https://developer.suki.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Form Filling SDK Authentication

> Sign in to Suki before Form filling opens: use SukiAuthManager with the Partner ID and Partner Token Suki gives you

The Form filling SDK uses a helper called `SukiAuthManager` from the `@suki-sdk/core` package. You give it the `partnerId` and `partnerToken` Suki assigned to your app. You create this helper once, then pass it to `FormFillingClient` in JavaScript or to `FormFillingProvider` in React.

After sign-in works, Suki can show the Form filling experience (the hosted UI where clinicians speak and submit) inside your page. The helper also renews access when it expires. If the ID or token is wrong, or sign-in never finishes, Form filling will not open.

## Prerequisites

Before you set up `SukiAuthManager`, you must have:

* Partner ID (the `partnerId` value): Suki gives you this when you complete [Partner onboarding](/documentation/get-started/partner-onboarding).
* Partner Token (the `partnerToken` value): The access value your program uses for this SDK. Your Suki contact explains how you get it and what it looks like.

## Using SukiAuthManager for authentication

Create the helper when your app already knows `partnerId` and `partnerToken` by running the following code:

```javascript JavaScript expandable theme={"theme":{"light":"github-dark","dark":"material-theme-darker"}}
import { SukiAuthManager } from "@suki-sdk/core";

const authManager = new SukiAuthManager({
  partnerId: "YOUR_PARTNER_ID", // required
  partnerToken: "YOUR_PARTNER_TOKEN", // required
  environment: "staging", // optional: "staging" or "production"
  loginOnInitialize: true, // optional (default false)
  autoRegister: false, // optional (default true); when true, provider fields below are often required
  providerId: "YOUR_PROVIDER_ID", // optional; provider identifier in your system
  providerName: "YOUR_PROVIDER_NAME", // optional; full name, often required if autoRegister is true
  providerOrgId: "YOUR_PROVIDER_ORG_ID", // optional; org in your system, often required if autoRegister is true
  providerSpecialty: "FAMILY_MEDICINE", // optional
});
```

## What SukiAuthManager does

* Checks your settings before Form filling tries to open.
* Signs in to Suki's platform with your partner details.
* Renews access when the SDK needs a fresh session.
* Lets Suki's hosted Form filling UI run with the right permissions.

<Warning>
  A bad `partnerId` or `partnerToken` stops Form filling from loading. The hosted UI will not appear until sign-in succeeds.
</Warning>

Refer to [Prerequisites](/form-filling-sdk/prerequisites) for provider context and [Configuration](/form-filling-sdk/guides/configuration) for session options after sign-in.

<Note>
  `autoRegister` defaults to `true`. When it is `true`, you must also pass `providerName` and `providerOrgId`. Set `autoRegister` to `false` unless your integration uses provider auto-registration.
</Note>

## Sign in later with login()

You can create `SukiAuthManager` first and call `login()` when your app is ready, instead of `loginOnInitialize: true`.

## Next steps

<Icon icon="file-lines" iconType="solid" /> Refer to the [Quickstart](/form-filling-sdk/quickstart) to create `FormFillingClient` with your auth manager.
