azirid-react 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -21
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -10
- package/dist/index.d.ts +1 -10
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,10 +33,7 @@ import { AziridProvider } from 'azirid-react'
|
|
|
33
33
|
|
|
34
34
|
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
35
35
|
return (
|
|
36
|
-
<AziridProvider
|
|
37
|
-
publishableKey={process.env.NEXT_PUBLIC_AZIRID_PK!}
|
|
38
|
-
apiUrl={process.env.NEXT_PUBLIC_AZIRID_API_URL}
|
|
39
|
-
>
|
|
36
|
+
<AziridProvider publishableKey={process.env.NEXT_PUBLIC_AZIRID_PK!}>
|
|
40
37
|
{children}
|
|
41
38
|
</AziridProvider>
|
|
42
39
|
)
|
|
@@ -76,10 +73,7 @@ export default function LoginPage() {
|
|
|
76
73
|
|
|
77
74
|
```env
|
|
78
75
|
# .env
|
|
79
|
-
NEXT_PUBLIC_AZIRID_API_URL=https://api.azirid.com
|
|
80
76
|
NEXT_PUBLIC_AZIRID_PK=pk_live_...
|
|
81
|
-
# Server-side only (used by middleware for JWKS validation)
|
|
82
|
-
AZIRID_API_URL=https://api.azirid.com
|
|
83
77
|
```
|
|
84
78
|
|
|
85
79
|
---
|
|
@@ -93,10 +87,7 @@ AZIRID_API_URL=https://api.azirid.com
|
|
|
93
87
|
import { AziridProvider } from 'azirid-react'
|
|
94
88
|
|
|
95
89
|
createRoot(document.getElementById('root')!).render(
|
|
96
|
-
<AziridProvider
|
|
97
|
-
apiUrl={import.meta.env.VITE_AZIRID_API_URL || 'https://api.azirid.com'}
|
|
98
|
-
publishableKey={import.meta.env.VITE_AZIRID_PK}
|
|
99
|
-
>
|
|
90
|
+
<AziridProvider publishableKey={import.meta.env.VITE_AZIRID_PK}>
|
|
100
91
|
<App />
|
|
101
92
|
</AziridProvider>,
|
|
102
93
|
)
|
|
@@ -105,7 +96,6 @@ createRoot(document.getElementById('root')!).render(
|
|
|
105
96
|
### 2. Configure your environment
|
|
106
97
|
|
|
107
98
|
```env
|
|
108
|
-
VITE_AZIRID_API_URL=https://api.azirid.com
|
|
109
99
|
VITE_AZIRID_PK=pk_live_...
|
|
110
100
|
```
|
|
111
101
|
|
|
@@ -1306,7 +1296,6 @@ function createAccessClient(
|
|
|
1306
1296
|
| Prop | Type | Default | Description |
|
|
1307
1297
|
| ------------------ | ------------------------- | ------- | -------------------------------------------------------------------------------- |
|
|
1308
1298
|
| `children` | `ReactNode` | — | **Required.** Your app tree |
|
|
1309
|
-
| `apiUrl` | `string` | `https://api.azirid.com` | Azirid API URL. Set for local dev or custom deployments |
|
|
1310
1299
|
| `publishableKey` | `string` | — | Publishable key (e.g. `pk_live_...`) |
|
|
1311
1300
|
| `tenantId` | `string` | — | Tenant ID for multi-tenant apps |
|
|
1312
1301
|
| `fetchOptions` | `Record<string, string>` | — | Extra headers to send with every request |
|
|
@@ -1453,12 +1442,6 @@ export const config = {
|
|
|
1453
1442
|
| `publicRoutes` | `string[]` | login/signup | Always-accessible routes |
|
|
1454
1443
|
| `jwksUrl` | `string` | auto | Override JWKS endpoint URL |
|
|
1455
1444
|
|
|
1456
|
-
Environment: set `AZIRID_API_URL` (server-side only) so the middleware knows where to fetch JWKS from.
|
|
1457
|
-
|
|
1458
|
-
```env
|
|
1459
|
-
AZIRID_API_URL=http://localhost:3000
|
|
1460
|
-
```
|
|
1461
|
-
|
|
1462
1445
|
---
|
|
1463
1446
|
|
|
1464
1447
|
## Server-side (Next.js App Router)
|
|
@@ -1489,7 +1472,7 @@ export async function getProfile() {
|
|
|
1489
1472
|
const token = await getSessionToken()
|
|
1490
1473
|
if (!token) throw new Error('Not authenticated')
|
|
1491
1474
|
|
|
1492
|
-
const res = await fetch(
|
|
1475
|
+
const res = await fetch('https://api.azirid.com/v1/users/auth/me', {
|
|
1493
1476
|
headers: { Authorization: `Bearer ${token}` },
|
|
1494
1477
|
})
|
|
1495
1478
|
return res.json()
|
|
@@ -1507,7 +1490,7 @@ export default async function DashboardPage() {
|
|
|
1507
1490
|
const token = await getSessionToken()
|
|
1508
1491
|
if (!token) redirect('/login')
|
|
1509
1492
|
|
|
1510
|
-
const res = await fetch(
|
|
1493
|
+
const res = await fetch('https://api.azirid.com/v1/users/auth/me', {
|
|
1511
1494
|
headers: { Authorization: `Bearer ${token}` },
|
|
1512
1495
|
})
|
|
1513
1496
|
const user = await res.json()
|
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -202,16 +202,7 @@ interface RegisterPasskeyData {
|
|
|
202
202
|
}
|
|
203
203
|
interface AziridProviderProps {
|
|
204
204
|
children: ReactNode;
|
|
205
|
-
/**
|
|
206
|
-
* Azirid API URL. Defaults to `https://api.azirid.com`.
|
|
207
|
-
*
|
|
208
|
-
* Set this to your API URL for local development or custom deployments.
|
|
209
|
-
*
|
|
210
|
-
* @example
|
|
211
|
-
* ```tsx
|
|
212
|
-
* <AziridProvider apiUrl="http://localhost:3000" publishableKey="pk_dev_...">
|
|
213
|
-
* ```
|
|
214
|
-
*/
|
|
205
|
+
/** @internal Override API URL. Only for Azirid monorepo development. */
|
|
215
206
|
apiUrl?: string;
|
|
216
207
|
/** Extra headers to send with every request */
|
|
217
208
|
fetchOptions?: Record<string, string>;
|
package/dist/index.d.ts
CHANGED
|
@@ -202,16 +202,7 @@ interface RegisterPasskeyData {
|
|
|
202
202
|
}
|
|
203
203
|
interface AziridProviderProps {
|
|
204
204
|
children: ReactNode;
|
|
205
|
-
/**
|
|
206
|
-
* Azirid API URL. Defaults to `https://api.azirid.com`.
|
|
207
|
-
*
|
|
208
|
-
* Set this to your API URL for local development or custom deployments.
|
|
209
|
-
*
|
|
210
|
-
* @example
|
|
211
|
-
* ```tsx
|
|
212
|
-
* <AziridProvider apiUrl="http://localhost:3000" publishableKey="pk_dev_...">
|
|
213
|
-
* ```
|
|
214
|
-
*/
|
|
205
|
+
/** @internal Override API URL. Only for Azirid monorepo development. */
|
|
215
206
|
apiUrl?: string;
|
|
216
207
|
/** Extra headers to send with every request */
|
|
217
208
|
fetchOptions?: Record<string, string>;
|
package/dist/index.js
CHANGED
|
@@ -4851,7 +4851,7 @@ function usePasswordToggle() {
|
|
|
4851
4851
|
}
|
|
4852
4852
|
|
|
4853
4853
|
// src/index.ts
|
|
4854
|
-
var SDK_VERSION = "0.14.
|
|
4854
|
+
var SDK_VERSION = "0.14.1";
|
|
4855
4855
|
|
|
4856
4856
|
export { AUTH_BASE_PATH, AuthForm, AziridProvider, CheckoutButton, ForgotPasswordForm, HandoffCallback, InvoiceList, LoginForm, PATHS, PayButton, PayphoneCallback, PayphoneWidgetRenderer, PricingTable, ReferralCard, ReferralStats, ResetPasswordForm, SDK_VERSION, SignupForm, SubscriptionBadge, buildPaths, changePasswordSchema, cn, createAccessClient, createForgotPasswordSchema, createLoginSchema, createMutationHook, createResetPasswordConfirmSchema, createSignupSchema, en, es, forgotPasswordSchema, isAuthError, loginSchema, magicLinkRequestSchema, magicLinkVerifySchema, passkeyRegisterStartSchema, removeStyles, resetPasswordConfirmSchema, resolveMessages, signupSchema, socialLoginSchema, useAccessClient, useAzirid, useBootstrap, useBranches, useBranding, useChangePassword, useCheckout, useFormState, useInvoices, useLogin, useLogout, useMagicLink, useMessages, usePasskeys, usePasswordReset, usePasswordToggle, usePayButton, usePaymentMethods, usePaymentProviders, usePayphoneCheckout, usePayphoneConfirm, usePlans, useReferral, useReferralStats, useRefresh, useSession, useSignup, useSocialLogin, useSubmitTransferProof, useSubscription, useSwitchTenant, useTenantMembers, useTenants, useTransferPayment, useTransferProofs, useUploadTransferProof };
|
|
4857
4857
|
//# sourceMappingURL=index.js.map
|