transactional-auth-next 0.1.0

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.
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Transactional Auth Next - Types
3
+ */
4
+ interface TransactionalAuthConfig {
5
+ /** Auth domain (e.g., 'auth.usetransactional.com') */
6
+ domain: string;
7
+ /** Client ID of your application */
8
+ clientId: string;
9
+ /** Client secret (for server-side only) */
10
+ clientSecret?: string;
11
+ /** Base URL of your application */
12
+ baseUrl?: string;
13
+ /** Scopes to request (defaults to 'openid profile email') */
14
+ scope?: string;
15
+ /** API audience for access token */
16
+ audience?: string;
17
+ /** Cookie name for session (defaults to 'transactional_session') */
18
+ cookieName?: string;
19
+ /** Cookie options */
20
+ cookieOptions?: {
21
+ secure?: boolean;
22
+ sameSite?: 'strict' | 'lax' | 'none';
23
+ maxAge?: number;
24
+ };
25
+ }
26
+ interface TransactionalAuthUser {
27
+ sub: string;
28
+ email?: string;
29
+ emailVerified?: boolean;
30
+ name?: string;
31
+ givenName?: string;
32
+ familyName?: string;
33
+ picture?: string;
34
+ phoneNumber?: string;
35
+ phoneNumberVerified?: boolean;
36
+ }
37
+ interface Session {
38
+ user: TransactionalAuthUser;
39
+ accessToken: string;
40
+ refreshToken?: string;
41
+ idToken?: string;
42
+ expiresAt: number;
43
+ }
44
+ interface LoginOptions {
45
+ /** Return URL after login */
46
+ returnTo?: string;
47
+ /** Force specific connection */
48
+ connection?: string;
49
+ /** Login hint (pre-fill email) */
50
+ loginHint?: string;
51
+ }
52
+ interface LogoutOptions {
53
+ /** Return URL after logout */
54
+ returnTo?: string;
55
+ }
56
+
57
+ export type { LoginOptions as L, Session as S, TransactionalAuthConfig as T, TransactionalAuthUser as a, LogoutOptions as b };
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Transactional Auth Next - Types
3
+ */
4
+ interface TransactionalAuthConfig {
5
+ /** Auth domain (e.g., 'auth.usetransactional.com') */
6
+ domain: string;
7
+ /** Client ID of your application */
8
+ clientId: string;
9
+ /** Client secret (for server-side only) */
10
+ clientSecret?: string;
11
+ /** Base URL of your application */
12
+ baseUrl?: string;
13
+ /** Scopes to request (defaults to 'openid profile email') */
14
+ scope?: string;
15
+ /** API audience for access token */
16
+ audience?: string;
17
+ /** Cookie name for session (defaults to 'transactional_session') */
18
+ cookieName?: string;
19
+ /** Cookie options */
20
+ cookieOptions?: {
21
+ secure?: boolean;
22
+ sameSite?: 'strict' | 'lax' | 'none';
23
+ maxAge?: number;
24
+ };
25
+ }
26
+ interface TransactionalAuthUser {
27
+ sub: string;
28
+ email?: string;
29
+ emailVerified?: boolean;
30
+ name?: string;
31
+ givenName?: string;
32
+ familyName?: string;
33
+ picture?: string;
34
+ phoneNumber?: string;
35
+ phoneNumberVerified?: boolean;
36
+ }
37
+ interface Session {
38
+ user: TransactionalAuthUser;
39
+ accessToken: string;
40
+ refreshToken?: string;
41
+ idToken?: string;
42
+ expiresAt: number;
43
+ }
44
+ interface LoginOptions {
45
+ /** Return URL after login */
46
+ returnTo?: string;
47
+ /** Force specific connection */
48
+ connection?: string;
49
+ /** Login hint (pre-fill email) */
50
+ loginHint?: string;
51
+ }
52
+ interface LogoutOptions {
53
+ /** Return URL after logout */
54
+ returnTo?: string;
55
+ }
56
+
57
+ export type { LoginOptions as L, Session as S, TransactionalAuthConfig as T, TransactionalAuthUser as a, LogoutOptions as b };
package/package.json ADDED
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "transactional-auth-next",
3
+ "version": "0.1.0",
4
+ "description": "Next.js SDK for Transactional Auth - OpenID Connect authentication for Next.js applications",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.mjs",
11
+ "require": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ },
14
+ "./client": {
15
+ "import": "./dist/client/index.mjs",
16
+ "require": "./dist/client/index.js",
17
+ "types": "./dist/client/index.d.ts"
18
+ },
19
+ "./server": {
20
+ "import": "./dist/server/index.mjs",
21
+ "require": "./dist/server/index.js",
22
+ "types": "./dist/server/index.d.ts"
23
+ },
24
+ "./middleware": {
25
+ "import": "./dist/middleware/index.mjs",
26
+ "require": "./dist/middleware/index.js",
27
+ "types": "./dist/middleware/index.d.ts"
28
+ }
29
+ },
30
+ "sideEffects": false,
31
+ "files": [
32
+ "dist",
33
+ "README.md"
34
+ ],
35
+ "scripts": {
36
+ "build": "tsup src/index.ts src/client/index.ts src/server/index.ts src/middleware/index.ts --format cjs,esm --dts --clean",
37
+ "dev": "tsup src/index.ts src/client/index.ts src/server/index.ts src/middleware/index.ts --format cjs,esm --dts --watch",
38
+ "typecheck": "tsc --noEmit",
39
+ "lint": "eslint src --ext .ts,.tsx",
40
+ "prepublishOnly": "npm run build"
41
+ },
42
+ "keywords": [
43
+ "next",
44
+ "nextjs",
45
+ "react",
46
+ "auth",
47
+ "authentication",
48
+ "oidc",
49
+ "openid-connect",
50
+ "oauth2",
51
+ "transactional",
52
+ "app-router",
53
+ "server-components"
54
+ ],
55
+ "author": "Transactional",
56
+ "license": "MIT",
57
+ "repository": {
58
+ "type": "git",
59
+ "url": "https://github.com/TransactionalHQ/transactional-auth-next"
60
+ },
61
+ "homepage": "https://github.com/TransactionalHQ/transactional-auth-next#readme",
62
+ "bugs": {
63
+ "url": "https://github.com/TransactionalHQ/transactional-auth-next/issues"
64
+ },
65
+ "peerDependencies": {
66
+ "next": "^13.0.0 || ^14.0.0 || ^15.0.0",
67
+ "react": "^18.0.0 || ^19.0.0"
68
+ },
69
+ "dependencies": {
70
+ "jose": "^5.2.0"
71
+ },
72
+ "devDependencies": {
73
+ "@types/node": "^20.11.0",
74
+ "@types/react": "^18.2.0",
75
+ "next": "^14.0.0",
76
+ "react": "^18.2.0",
77
+ "tsup": "^8.0.0",
78
+ "typescript": "^5.5.0"
79
+ }
80
+ }