Skip to content

Commit fd3152a

Browse files
committed
lint
1 parent b8f6dcd commit fd3152a

1 file changed

Lines changed: 31 additions & 31 deletions

File tree

README.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { createRoot } from "react-dom/client";
2424
createRoot(document.getElementById("root")).render(
2525
<AuthKitProvider clientId="client_01ABC123DEF456">
2626
<App />
27-
</AuthKitProvider>
27+
</AuthKitProvider>,
2828
);
2929
```
3030

@@ -102,47 +102,47 @@ That's it — you have a fully authenticated React app.
102102
103103
Wrap your app in this component to provide authentication context.
104104
105-
| Prop | Type | Required | Description |
106-
|---------------|----------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------|
107-
| `clientId` | `string` | Yes | Your WorkOS Client ID (starts with `client_`) |
108-
| `apiHostname` | `string` | No | Your custom Authentication API domain. Defaults to api.workos.com. In production, this should be set to a domain you own (e.g. auth.example.com) |
109-
| `devMode` | `boolean` | No | Stores tokens in localStorage. Auto-enabled on `localhost` and `127.0.0.1`. |
110-
| `onRedirectCallback` | `(params) => void` | No | Called after a successful authentication. Use to restore app state or navigate. |
111-
| `onRefresh` | `(response) => void` | No | Called when the access token is refreshed. |
112-
| `onRefreshFailure` | `({ signIn }) => void` | No | Called when token refresh fails. Receives `signIn` to trigger re-authentication. |
113-
| `onBeforeAutoRefresh` | `() => boolean` | No | Called before automatic refresh. Return `false` to skip. |
114-
| `refreshBufferInterval` | `number` | No | Seconds before token expiration to trigger refresh. |
105+
| Prop | Type | Required | Description |
106+
| ----------------------- | ---------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
107+
| `clientId` | `string` | Yes | Your WorkOS Client ID (starts with `client_`) |
108+
| `apiHostname` | `string` | No | Your custom Authentication API domain. Defaults to api.workos.com. In production, this should be set to a domain you own (e.g. auth.example.com) |
109+
| `devMode` | `boolean` | No | Stores tokens in localStorage. Auto-enabled on `localhost` and `127.0.0.1`. |
110+
| `onRedirectCallback` | `(params) => void` | No | Called after a successful authentication. Use to restore app state or navigate. |
111+
| `onRefresh` | `(response) => void` | No | Called when the access token is refreshed. |
112+
| `onRefreshFailure` | `({ signIn }) => void` | No | Called when token refresh fails. Receives `signIn` to trigger re-authentication. |
113+
| `onBeforeAutoRefresh` | `() => boolean` | No | Called before automatic refresh. Return `false` to skip. |
114+
| `refreshBufferInterval` | `number` | No | Seconds before token expiration to trigger refresh. |
115115
116116
### `useAuth()`
117117
118118
Returns the current auth state and helper methods. Must be called inside `<AuthKitProvider>`.
119119
120120
#### State
121121
122-
| Property | Type | Description |
123-
|----------|------|-------------|
124-
| `isLoading` | `boolean` | `true` during initial authentication check |
125-
| `user` | `User \| null` | The authenticated user, or `null` |
126-
| `organizationId` | `string \| null` | The user's current organization |
127-
| `role` | `string \| null` | The user's role in the current organization |
128-
| `roles` | `string[] \| null` | All roles for the user in the current organization |
129-
| `permissions` | `string[]` | Permissions for the user's role |
130-
| `featureFlags` | `string[]` | Feature flags enabled for the organization |
131-
| `impersonator` | `Impersonator \| null` | Set when an admin is impersonating this user |
122+
| Property | Type | Description |
123+
| ---------------------- | ------------------------------ | ---------------------------------------------------------- |
124+
| `isLoading` | `boolean` | `true` during initial authentication check |
125+
| `user` | `User \| null` | The authenticated user, or `null` |
126+
| `organizationId` | `string \| null` | The user's current organization |
127+
| `role` | `string \| null` | The user's role in the current organization |
128+
| `roles` | `string[] \| null` | All roles for the user in the current organization |
129+
| `permissions` | `string[]` | Permissions for the user's role |
130+
| `featureFlags` | `string[]` | Feature flags enabled for the organization |
131+
| `impersonator` | `Impersonator \| null` | Set when an admin is impersonating this user |
132132
| `authenticationMethod` | `AuthenticationMethod \| null` | How the user authenticated (e.g. `"GoogleOAuth"`, `"SSO"`) |
133133
134134
#### Methods
135135
136-
| Method | Signature | Description |
137-
|--------|-----------|-------------|
138-
| `signIn` | `(opts?) => Promise<void>` | Redirect to the AuthKit sign-in page |
139-
| `signUp` | `(opts?) => Promise<void>` | Redirect to the AuthKit sign-up page |
140-
| `signOut` | `(opts?) => void` | End the session and sign the user out |
141-
| `getAccessToken` | `(opts?) => Promise<string>` | Get a valid access token, refreshing if needed |
142-
| `getUser` | `() => User \| null` | Synchronously get the current user |
143-
| `switchToOrganization` | `({ organizationId, signInOpts? }) => Promise<void>` | Switch to a different organization |
144-
| `getSignInUrl` | `(opts?) => Promise<string>` | Get the sign-in URL without redirecting |
145-
| `getSignUpUrl` | `(opts?) => Promise<string>` | Get the sign-up URL without redirecting |
136+
| Method | Signature | Description |
137+
| ---------------------- | ---------------------------------------------------- | ---------------------------------------------- |
138+
| `signIn` | `(opts?) => Promise<void>` | Redirect to the AuthKit sign-in page |
139+
| `signUp` | `(opts?) => Promise<void>` | Redirect to the AuthKit sign-up page |
140+
| `signOut` | `(opts?) => void` | End the session and sign the user out |
141+
| `getAccessToken` | `(opts?) => Promise<string>` | Get a valid access token, refreshing if needed |
142+
| `getUser` | `() => User \| null` | Synchronously get the current user |
143+
| `switchToOrganization` | `({ organizationId, signInOpts? }) => Promise<void>` | Switch to a different organization |
144+
| `getSignInUrl` | `(opts?) => Promise<string>` | Get the sign-in URL without redirecting |
145+
| `getSignUpUrl` | `(opts?) => Promise<string>` | Get the sign-up URL without redirecting |
146146
147147
#### `signIn` / `signUp` Options
148148

0 commit comments

Comments
 (0)