@usetransactional/auth-next 0.1.0 → 0.1.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 CHANGED
@@ -1,15 +1,15 @@
1
- # transactional-auth-next
1
+ # @usetransactional/auth-next
2
2
 
3
3
  Next.js SDK for Transactional Auth - OpenID Connect authentication with full support for App Router, Server Components, and Middleware.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install transactional-auth-next
8
+ npm install @usetransactional/auth-next
9
9
  # or
10
- yarn add transactional-auth-next
10
+ yarn add @usetransactional/auth-next
11
11
  # or
12
- pnpm add transactional-auth-next
12
+ pnpm add @usetransactional/auth-next
13
13
  ```
14
14
 
15
15
  ## Quick Start
@@ -34,7 +34,7 @@ import {
34
34
  handleCallback,
35
35
  handleLogout,
36
36
  handleSession,
37
- } from 'transactional-auth-next/server';
37
+ } from '@usetransactional/auth-next/server';
38
38
  import { NextRequest } from 'next/server';
39
39
 
40
40
  export async function GET(
@@ -62,7 +62,7 @@ export async function GET(
62
62
 
63
63
  ```tsx
64
64
  // app/layout.tsx
65
- import { TransactionalAuthProvider } from 'transactional-auth-next/client';
65
+ import { TransactionalAuthProvider } from '@usetransactional/auth-next/client';
66
66
 
67
67
  export default function RootLayout({
68
68
  children,
@@ -85,7 +85,7 @@ export default function RootLayout({
85
85
 
86
86
  ```tsx
87
87
  // app/page.tsx
88
- import { getSession, getUser } from 'transactional-auth-next/server';
88
+ import { getSession, getUser } from '@usetransactional/auth-next/server';
89
89
 
90
90
  export default async function Page() {
91
91
  const session = await getSession();
@@ -109,7 +109,7 @@ export default async function Page() {
109
109
  // components/login-button.tsx
110
110
  'use client';
111
111
 
112
- import { useAuth } from 'transactional-auth-next/client';
112
+ import { useAuth } from '@usetransactional/auth-next/client';
113
113
 
114
114
  export function LoginButton() {
115
115
  const { user, isLoading, login, logout } = useAuth();
@@ -135,7 +135,7 @@ export function LoginButton() {
135
135
 
136
136
  ```ts
137
137
  // middleware.ts
138
- import { createAuthMiddleware } from 'transactional-auth-next/middleware';
138
+ import { createAuthMiddleware } from '@usetransactional/auth-next/middleware';
139
139
 
140
140
  export default createAuthMiddleware({
141
141
  protectedPaths: ['/dashboard/*', '/settings/*', '/api/protected/*'],
@@ -151,7 +151,7 @@ export const config = {
151
151
 
152
152
  ```ts
153
153
  // app/api/protected/route.ts
154
- import { withAuth } from 'transactional-auth-next/middleware';
154
+ import { withAuth } from '@usetransactional/auth-next/middleware';
155
155
  import { NextRequest } from 'next/server';
156
156
 
157
157
  export const GET = withAuth(async (request, session) => {
@@ -164,7 +164,7 @@ export const GET = withAuth(async (request, session) => {
164
164
 
165
165
  ## API Reference
166
166
 
167
- ### Server Functions (`transactional-auth-next/server`)
167
+ ### Server Functions (`@usetransactional/auth-next/server`)
168
168
 
169
169
  #### `getSession()`
170
170
 
@@ -207,7 +207,7 @@ const authenticated = await isAuthenticated();
207
207
  - `handleLogout(options?)` - Logs out user
208
208
  - `handleSession()` - Returns current session as JSON
209
209
 
210
- ### Client Functions (`transactional-auth-next/client`)
210
+ ### Client Functions (`@usetransactional/auth-next/client`)
211
211
 
212
212
  #### `TransactionalAuthProvider`
213
213
 
@@ -235,7 +235,7 @@ Hook for just user data.
235
235
  const { user, isLoading } = useUser();
236
236
  ```
237
237
 
238
- ### Middleware (`transactional-auth-next/middleware`)
238
+ ### Middleware (`@usetransactional/auth-next/middleware`)
239
239
 
240
240
  #### `createAuthMiddleware(config)`
241
241
 
@@ -275,7 +275,7 @@ export const GET = withAuth(async (request, session) => {
275
275
  ### Programmatic Configuration
276
276
 
277
277
  ```ts
278
- import { initTransactionalAuth } from 'transactional-auth-next';
278
+ import { initTransactionalAuth } from '@usetransactional/auth-next';
279
279
 
280
280
  initTransactionalAuth({
281
281
  domain: 'auth.usetransactional.com',
@@ -304,7 +304,7 @@ import type {
304
304
  Session,
305
305
  LoginOptions,
306
306
  LogoutOptions,
307
- } from 'transactional-auth-next';
307
+ } from '@usetransactional/auth-next';
308
308
  ```
309
309
 
310
310
  ## License
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import { a as TransactionalAuthUser } from '../types-D3JPYyLl.mjs';
3
+ import { b as TransactionalAuthUser } from '../types-f5YahDTL.mjs';
4
4
 
5
5
  interface AuthContextValue {
6
6
  user: TransactionalAuthUser | null;
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import { a as TransactionalAuthUser } from '../types-D3JPYyLl.js';
3
+ import { b as TransactionalAuthUser } from '../types-f5YahDTL.js';
4
4
 
5
5
  interface AuthContextValue {
6
6
  user: TransactionalAuthUser | null;
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as TransactionalAuthConfig } from './types-D3JPYyLl.mjs';
2
- export { L as LoginOptions, b as LogoutOptions, S as Session, a as TransactionalAuthUser } from './types-D3JPYyLl.mjs';
1
+ import { T as TransactionalAuthConfig } from './types-f5YahDTL.mjs';
2
+ export { L as LoginOptions, a as LogoutOptions, S as Session, b as TransactionalAuthUser } from './types-f5YahDTL.mjs';
3
3
 
4
4
  /**
5
5
  * Transactional Auth Next - Configuration
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as TransactionalAuthConfig } from './types-D3JPYyLl.js';
2
- export { L as LoginOptions, b as LogoutOptions, S as Session, a as TransactionalAuthUser } from './types-D3JPYyLl.js';
1
+ import { T as TransactionalAuthConfig } from './types-f5YahDTL.js';
2
+ export { L as LoginOptions, a as LogoutOptions, S as Session, b as TransactionalAuthUser } from './types-f5YahDTL.js';
3
3
 
4
4
  /**
5
5
  * Transactional Auth Next - Configuration
@@ -1,5 +1,5 @@
1
1
  import { NextRequest, NextResponse } from 'next/server';
2
- import { S as Session } from '../types-D3JPYyLl.mjs';
2
+ import { S as Session } from '../types-f5YahDTL.mjs';
3
3
 
4
4
  /**
5
5
  * Transactional Auth Next - Middleware
@@ -1,5 +1,5 @@
1
1
  import { NextRequest, NextResponse } from 'next/server';
2
- import { S as Session } from '../types-D3JPYyLl.js';
2
+ import { S as Session } from '../types-f5YahDTL.js';
3
3
 
4
4
  /**
5
5
  * Transactional Auth Next - Middleware
@@ -1,4 +1,4 @@
1
- import { S as Session, a as TransactionalAuthUser, L as LoginOptions, b as LogoutOptions } from '../types-D3JPYyLl.mjs';
1
+ import { S as Session, b as TransactionalAuthUser, L as LoginOptions, a as LogoutOptions } from '../types-f5YahDTL.mjs';
2
2
  import { NextRequest, NextResponse } from 'next/server';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { S as Session, a as TransactionalAuthUser, L as LoginOptions, b as LogoutOptions } from '../types-D3JPYyLl.js';
1
+ import { S as Session, b as TransactionalAuthUser, L as LoginOptions, a as LogoutOptions } from '../types-f5YahDTL.js';
2
2
  import { NextRequest, NextResponse } from 'next/server';
3
3
 
4
4
  /**
@@ -54,4 +54,4 @@ interface LogoutOptions {
54
54
  returnTo?: string;
55
55
  }
56
56
 
57
- export type { LoginOptions as L, Session as S, TransactionalAuthConfig as T, TransactionalAuthUser as a, LogoutOptions as b };
57
+ export type { LoginOptions as L, Session as S, TransactionalAuthConfig as T, LogoutOptions as a, TransactionalAuthUser as b };
@@ -54,4 +54,4 @@ interface LogoutOptions {
54
54
  returnTo?: string;
55
55
  }
56
56
 
57
- export type { LoginOptions as L, Session as S, TransactionalAuthConfig as T, TransactionalAuthUser as a, LogoutOptions as b };
57
+ export type { LoginOptions as L, Session as S, TransactionalAuthConfig as T, LogoutOptions as a, TransactionalAuthUser as b };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usetransactional/auth-next",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Next.js SDK for Transactional Auth - OpenID Connect authentication for Next.js applications",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",