@telestack/auth-sdk 1.0.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.
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # @telestack/auth-sdk
2
+
3
+ A premium, Firebase-style fluent SDK for TelestackAuth, built on top of Better Auth.
4
+
5
+ ## Features
6
+
7
+ - **Fluent API**: Intuitive, chainable methods for authentication and user management.
8
+ - **Stateful Context**: Access `currentUser.profile`, `currentUser.security`, and `currentUser.session` with live updates.
9
+ - **Multi-Tenant Ready**: Seamlessly handle multiple projects/tenants.
10
+ - **Rich Plugin Support**: Includes Magic Link, Passkeys, OAuth, MFA, Organizations, and more.
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install @telestack/auth-sdk
16
+ ```
17
+
18
+ ## Quick Start
19
+
20
+ ```typescript
21
+ import { TelestackAuth } from "@telestack/auth-sdk";
22
+
23
+ // Initialize the SDK
24
+ const auth = TelestackAuth.initialize({
25
+ url: "https://your-api.telestack.run",
26
+ tenantId: "your-tenant-id"
27
+ });
28
+
29
+ // Sign in
30
+ await auth.auth.signInWithEmail({
31
+ email: "user@example.com",
32
+ password: "password123"
33
+ });
34
+
35
+ // Access current user
36
+ console.log(auth.currentUser.profile?.email);
37
+ ```
38
+
39
+ ## Documentation
40
+
41
+ For full documentation and advanced usage, visit [telestack.run/docs](https://telestack.run/docs).
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";var c=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var C=(a,n)=>{for(var s in n)c(a,s,{get:n[s],enumerable:!0})},b=(a,n,s,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of I(n))!w.call(a,e)&&e!==s&&c(a,e,{get:()=>n[e],enumerable:!(r=y(n,e))||r.enumerable});return a};var A=a=>b(c({},"__esModule",{value:!0}),a);var v={};C(v,{TelestackAuth:()=>u,createTelestackAuth:()=>g});module.exports=A(v);var m=require("better-auth/client"),t=require("better-auth/client/plugins"),d=require("@better-auth/passkey/client"),f=require("@better-auth/sso/client"),g=a=>{let n=null,s=null,r=null,e=(0,m.createAuthClient)({baseURL:`${a.url}/api/v1/${a.tenantId}/auth`,fetchOptions:a.fetchOptions,plugins:[(0,t.magicLinkClient)(),(0,d.passkeyClient)(),(0,t.organizationClient)(),(0,f.ssoClient)(),(0,t.twoFactorClient)(),(0,t.usernameClient)(),(0,t.multiSessionClient)(),(0,t.jwtClient)(),(0,t.adminClient)(),(0,t.apiKeyClient)(),(0,t.phoneNumberClient)(),(0,t.emailOTPClient)(),(0,t.anonymousClient)(),(0,t.genericOAuthClient)(),(0,t.oneTimeTokenClient)(),(0,t.deviceAuthorizationClient)(),...a?.googleClientId?[(0,t.oneTapClient)({clientId:a.googleClientId})]:[]]}),p=e.useSession;p&&p.subscribe(i=>{n=i?.data});let h=e.organization?.useActiveOrganization;return h&&h.subscribe(i=>{s=i?.data}),{rawClient:e,auth:{signInWithEmail:e.signIn.email,signInWithUsername:e.signIn.username,signInWithPhone:e.signIn.phoneNumber,signInWithGoogle:i=>e.signIn.social({provider:"google",...i}),signInWithGithub:i=>e.signIn.social({provider:"github",...i}),signInWithPasskey:e.signIn.passkey,signInAnonymously:e.signIn.anonymous,sendMagicLink:async i=>await e.signIn.magicLink({email:i.email,callbackURL:i.callbackURL||window.location.href}),signInWithMagicLink:e.signIn.magicLink,sendOtp:async i=>await e.emailOtp.sendVerificationOtp({email:i.email,type:"sign-in"}),signInWithOtp:e.signIn.emailOtp,signInWithSiwe:e.siwe?.signIn,signUpWithEmail:e.signUp.email,signOut:e.signOut,verifyEmail:e.verifyEmail,forgetPassword:e.forgetPassword,resetPassword:e.resetPassword},mfa:{enableTwoFactor:e.twoFactor.enable,disableTwoFactor:e.twoFactor.disable,sendOtp:e.twoFactor.sendOtp,verifyOtp:e.twoFactor.verifyTotp},user:{getSession:async()=>{let i=await e.getSession();return n=i?.data,i},listSessions:e.listSessions,updateProfile:e.updateUser,changeEmail:e.changeEmail,changePassword:e.changePassword,deleteAccount:e.deleteUser},organization:{create:e.organization.create,update:e.organization.update,setActive:e.organization.setActive,list:async()=>{let i=await e.organization.list();return r=i?.data,i},inviteMember:e.organization.inviteMember,acceptInvitation:e.organization.acceptInvitation,rejectInvitation:e.organization.rejectInvitation,removeMember:e.organization.removeMember},admin:{listUsers:e.admin.listUsers,impersonateUser:e.admin.impersonateUser,banUser:e.admin.banUser},sso:{signIn:e.signIn.sso,register:e.sso.register},apiKey:{create:e.apiKey.create,list:e.apiKey.list,delete:e.apiKey.delete},get currentUser(){return{get profile(){return n?.user},get security(){return{mfaEnabled:n?.user?.twoFactorEnabled||!1,lastLogin:n?.user?.updatedAt,isAnonymous:n?.user?.isAnonymous||!1}},get organizations(){return{active:s,all:r}},get session(){return{id:n?.session?.id,expiresAt:n?.session?.expiresAt,userAgent:n?.session?.userAgent}}}},onAuthStateChanged(i){let o=e.useSession;return o?o.subscribe(l=>{i(l?.data?.user||null)}):()=>{}},async syncState(){let i=await e.getSession();if(n=i?.data,e.organization){let[o,l]=await Promise.all([e.organization.list(),e.organization.getActiveOrganization()]);r=o?.data,s=l?.data}return i}}},u=class{static instance=null;static config=null;static initialize(n){return this.config=n,this.instance=g(n),this.instance}static updateConfig(n){if(!this.config)throw new Error("Initialize SDK first");return this.config={...this.config,...n},this.instance=g(this.config),this.instance}static setToken(n){if(!this.config)throw new Error("Initialize SDK first");return this.updateConfig({fetchOptions:{...this.config.fetchOptions,headers:{...this.config.fetchOptions?.headers,Authorization:`Bearer ${n}`}}})}static getInstance(){if(!this.instance)throw new Error("TelestackAuth has not been initialized. Call initialize(config) first.");return this.instance}};0&&(module.exports={TelestackAuth,createTelestackAuth});
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { createAuthClient } from \"better-auth/client\";\r\nimport {\r\n magicLinkClient,\r\n organizationClient,\r\n twoFactorClient,\r\n usernameClient,\r\n multiSessionClient,\r\n jwtClient,\r\n adminClient,\r\n apiKeyClient,\r\n phoneNumberClient,\r\n emailOTPClient,\r\n oneTapClient,\r\n genericOAuthClient,\r\n oneTimeTokenClient,\r\n deviceAuthorizationClient,\r\n anonymousClient,\r\n} from \"better-auth/client/plugins\";\r\nimport { passkeyClient } from \"@better-auth/passkey/client\";\r\nimport { ssoClient } from \"@better-auth/sso/client\";\r\n\r\nexport interface TelestackConfig {\r\n url: string;\r\n tenantId: string;\r\n googleClientId?: string;\r\n fetchOptions?: any;\r\n}\r\n\r\n// Internal factory to preserve strict typing when wrapping methods\r\nexport const createTelestackAuth = (config: TelestackConfig) => {\r\n let internalSession: any = null;\r\n let internalActiveOrg: any = null;\r\n let internalOrgs: any = null;\r\n\r\n // Inlining the plugins array is MANDATORY for Better Auth strict TypeScript inference.\r\n const rawClient = createAuthClient({\r\n baseURL: `${config.url}/api/v1/${config.tenantId}/auth`,\r\n fetchOptions: config.fetchOptions,\r\n plugins: [\r\n magicLinkClient(),\r\n passkeyClient(),\r\n organizationClient(),\r\n ssoClient(),\r\n twoFactorClient(),\r\n usernameClient(),\r\n multiSessionClient(),\r\n jwtClient(),\r\n adminClient(),\r\n apiKeyClient(),\r\n phoneNumberClient(),\r\n emailOTPClient(),\r\n anonymousClient(),\r\n genericOAuthClient(),\r\n oneTimeTokenClient(),\r\n deviceAuthorizationClient(),\r\n ...(config?.googleClientId ? [oneTapClient({ clientId: config.googleClientId })] : [])\r\n ]\r\n });\r\n\r\n // Subscribe to atoms for live updates while the closure lives\r\n const sessionAtom = (rawClient as any).useSession;\r\n if (sessionAtom) {\r\n sessionAtom.subscribe((state: any) => {\r\n internalSession = state?.data;\r\n });\r\n }\r\n\r\n const activeOrgAtom = (rawClient as any).organization?.useActiveOrganization;\r\n if (activeOrgAtom) {\r\n activeOrgAtom.subscribe((state: any) => {\r\n internalActiveOrg = state?.data;\r\n });\r\n }\r\n\r\n return {\r\n rawClient,\r\n auth: {\r\n signInWithEmail: rawClient.signIn.email,\r\n signInWithUsername: rawClient.signIn.username,\r\n signInWithPhone: rawClient.signIn.phoneNumber,\r\n signInWithGoogle: (options?: Parameters<typeof rawClient.signIn.social>[0]) => rawClient.signIn.social({ provider: \"google\", ...options }),\r\n signInWithGithub: (options?: Parameters<typeof rawClient.signIn.social>[0]) => rawClient.signIn.social({ provider: \"github\", ...options }),\r\n signInWithPasskey: rawClient.signIn.passkey,\r\n signInAnonymously: rawClient.signIn.anonymous,\r\n sendMagicLink: async (options: { email: string; callbackURL?: string }) => {\r\n return await rawClient.signIn.magicLink({\r\n email: options.email,\r\n callbackURL: options.callbackURL || window.location.href,\r\n });\r\n },\r\n signInWithMagicLink: rawClient.signIn.magicLink,\r\n sendOtp: async (options: { email: string }) => {\r\n return await rawClient.emailOtp.sendVerificationOtp({\r\n email: options.email,\r\n type: \"sign-in\"\r\n });\r\n },\r\n signInWithOtp: rawClient.signIn.emailOtp,\r\n signInWithSiwe: (rawClient as any).siwe?.signIn,\r\n signUpWithEmail: rawClient.signUp.email,\r\n signOut: rawClient.signOut,\r\n verifyEmail: rawClient.verifyEmail,\r\n forgetPassword: rawClient.forgetPassword,\r\n resetPassword: rawClient.resetPassword,\r\n },\r\n mfa: {\r\n enableTwoFactor: rawClient.twoFactor.enable,\r\n disableTwoFactor: rawClient.twoFactor.disable,\r\n sendOtp: rawClient.twoFactor.sendOtp,\r\n verifyOtp: rawClient.twoFactor.verifyTotp,\r\n },\r\n user: {\r\n getSession: async () => {\r\n const res = await (rawClient.getSession() as any);\r\n internalSession = res?.data;\r\n return res;\r\n },\r\n listSessions: rawClient.listSessions,\r\n updateProfile: rawClient.updateUser,\r\n changeEmail: rawClient.changeEmail,\r\n changePassword: rawClient.changePassword,\r\n deleteAccount: rawClient.deleteUser,\r\n },\r\n organization: {\r\n create: rawClient.organization.create,\r\n update: rawClient.organization.update,\r\n setActive: rawClient.organization.setActive,\r\n list: async () => {\r\n const res = await (rawClient.organization.list() as any);\r\n internalOrgs = res?.data;\r\n return res;\r\n },\r\n inviteMember: rawClient.organization.inviteMember,\r\n acceptInvitation: rawClient.organization.acceptInvitation,\r\n rejectInvitation: rawClient.organization.rejectInvitation,\r\n removeMember: rawClient.organization.removeMember,\r\n },\r\n admin: {\r\n listUsers: rawClient.admin.listUsers,\r\n impersonateUser: rawClient.admin.impersonateUser,\r\n banUser: rawClient.admin.banUser,\r\n },\r\n sso: {\r\n signIn: rawClient.signIn.sso,\r\n register: rawClient.sso.register,\r\n },\r\n apiKey: {\r\n create: rawClient.apiKey.create,\r\n list: rawClient.apiKey.list,\r\n delete: rawClient.apiKey.delete\r\n },\r\n /**\r\n * The Advanced User Context. Provides stateful access to user attributes,\r\n * security status, and organizational roles without constant API calls.\r\n */\r\n get currentUser() {\r\n return {\r\n get profile() {\r\n return internalSession?.user;\r\n },\r\n get security() {\r\n return {\r\n mfaEnabled: internalSession?.user?.twoFactorEnabled || false,\r\n lastLogin: internalSession?.user?.updatedAt,\r\n isAnonymous: internalSession?.user?.isAnonymous || false,\r\n };\r\n },\r\n get organizations() {\r\n return {\r\n active: internalActiveOrg,\r\n all: internalOrgs,\r\n };\r\n },\r\n get session() {\r\n return {\r\n id: internalSession?.session?.id,\r\n expiresAt: internalSession?.session?.expiresAt,\r\n userAgent: internalSession?.session?.userAgent,\r\n };\r\n },\r\n };\r\n },\r\n /**\r\n * Listens for authentication state changes (sign-in, sign-out, session refresh).\r\n */\r\n onAuthStateChanged(callback: (user: any | null) => void) {\r\n const atom = (rawClient as any).useSession;\r\n if (atom) {\r\n return atom.subscribe((state: any) => {\r\n callback(state?.data?.user || null);\r\n });\r\n }\r\n return () => { };\r\n },\r\n /**\r\n * Forces a synchronization of the local auth state with the server.\r\n */\r\n async syncState() {\r\n const session = await (rawClient.getSession() as any);\r\n internalSession = session?.data;\r\n if (rawClient.organization) {\r\n const [orgs, activeOrg] = await Promise.all([\r\n (rawClient.organization as any).list(),\r\n (rawClient.organization as any).getActiveOrganization()\r\n ]);\r\n internalOrgs = (orgs as any)?.data;\r\n internalActiveOrg = (activeOrg as any)?.data;\r\n }\r\n return session;\r\n }\r\n };\r\n};\r\n\r\nexport type TelestackAuthInstance = ReturnType<typeof createTelestackAuth>;\r\n\r\n/**\r\n * The core singleton SDK for TelestackAuth.\r\n * Designed entirely for extreme developer experience and Firebase-style fluency.\r\n */\r\nexport class TelestackAuth {\r\n private static instance: TelestackAuthInstance | null = null;\r\n private static config: TelestackConfig | null = null;\r\n\r\n /**\r\n * Initializes the TelestackAuth SDK. Must be called once at app startup.\r\n */\r\n public static initialize(config: TelestackConfig): TelestackAuthInstance {\r\n this.config = config;\r\n this.instance = createTelestackAuth(config);\r\n return this.instance;\r\n }\r\n\r\n /**\r\n * Updates the SDK configuration (e.g., adding a token).\r\n */\r\n public static updateConfig(config: Partial<TelestackConfig>): TelestackAuthInstance {\r\n if (!this.config) throw new Error(\"Initialize SDK first\");\r\n this.config = { ...this.config, ...config };\r\n this.instance = createTelestackAuth(this.config);\r\n return this.instance;\r\n }\r\n\r\n /**\r\n * Sets the Bearer token for all subsequent requests.\r\n */\r\n public static setToken(token: string): TelestackAuthInstance {\r\n if (!this.config) throw new Error(\"Initialize SDK first\");\r\n return this.updateConfig({\r\n fetchOptions: {\r\n ...this.config.fetchOptions,\r\n headers: {\r\n ...this.config.fetchOptions?.headers,\r\n \"Authorization\": `Bearer ${token}`\r\n }\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Retrieves the initialized instance of the SDK.\r\n */\r\n public static getInstance(): TelestackAuthInstance {\r\n if (!this.instance) {\r\n throw new Error(\"TelestackAuth has not been initialized. Call initialize(config) first.\");\r\n }\r\n return this.instance;\r\n }\r\n}\r\n\r\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,EAAA,wBAAAC,IAAA,eAAAC,EAAAJ,GAAA,IAAAK,EAAiC,8BACjCC,EAgBO,sCACPD,EAA8B,uCAC9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c,CACV,GAAG,KAAK,OAAO,aACf,QAAS,CACL,GAAG,KAAK,OAAO,cAAc,QAC7B,cAAiB,UAAUA,CAAK,EACpC,CACJ,CACJ,CAAC,CACL,CAKA,OAAc,aAAqC,CAC/C,GAAI,CAAC,KAAK,SACN,MAAM,IAAI,MAAM,wEAAwE,EAE5F,OAAO,KAAK,QAChB,CACJ","names":["index_exports","__export","TelestackAuth","createTelestackAuth","__toCommonJS","import_client","import_plugins","config","internalSession","internalActiveOrg","internalOrgs","rawClient","sessionAtom","state","activeOrgAtom","options","res","callback","atom","session","orgs","activeOrg","token"]}
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import{createAuthClient as p}from"better-auth/client";import{magicLinkClient as h,organizationClient as m,twoFactorClient as d,usernameClient as f,multiSessionClient as y,jwtClient as I,adminClient as w,apiKeyClient as C,phoneNumberClient as b,emailOTPClient as A,oneTapClient as v,genericOAuthClient as k,oneTimeTokenClient as z,deviceAuthorizationClient as O,anonymousClient as T}from"better-auth/client/plugins";import{passkeyClient as U}from"@better-auth/passkey/client";import{ssoClient as P}from"@better-auth/sso/client";var g=i=>{let n=null,s=null,r=null,e=p({baseURL:`${i.url}/api/v1/${i.tenantId}/auth`,fetchOptions:i.fetchOptions,plugins:[h(),U(),m(),P(),d(),f(),y(),I(),w(),C(),b(),A(),T(),k(),z(),O(),...i?.googleClientId?[v({clientId:i.googleClientId})]:[]]}),l=e.useSession;l&&l.subscribe(t=>{n=t?.data});let c=e.organization?.useActiveOrganization;return c&&c.subscribe(t=>{s=t?.data}),{rawClient:e,auth:{signInWithEmail:e.signIn.email,signInWithUsername:e.signIn.username,signInWithPhone:e.signIn.phoneNumber,signInWithGoogle:t=>e.signIn.social({provider:"google",...t}),signInWithGithub:t=>e.signIn.social({provider:"github",...t}),signInWithPasskey:e.signIn.passkey,signInAnonymously:e.signIn.anonymous,sendMagicLink:async t=>await e.signIn.magicLink({email:t.email,callbackURL:t.callbackURL||window.location.href}),signInWithMagicLink:e.signIn.magicLink,sendOtp:async t=>await e.emailOtp.sendVerificationOtp({email:t.email,type:"sign-in"}),signInWithOtp:e.signIn.emailOtp,signInWithSiwe:e.siwe?.signIn,signUpWithEmail:e.signUp.email,signOut:e.signOut,verifyEmail:e.verifyEmail,forgetPassword:e.forgetPassword,resetPassword:e.resetPassword},mfa:{enableTwoFactor:e.twoFactor.enable,disableTwoFactor:e.twoFactor.disable,sendOtp:e.twoFactor.sendOtp,verifyOtp:e.twoFactor.verifyTotp},user:{getSession:async()=>{let t=await e.getSession();return n=t?.data,t},listSessions:e.listSessions,updateProfile:e.updateUser,changeEmail:e.changeEmail,changePassword:e.changePassword,deleteAccount:e.deleteUser},organization:{create:e.organization.create,update:e.organization.update,setActive:e.organization.setActive,list:async()=>{let t=await e.organization.list();return r=t?.data,t},inviteMember:e.organization.inviteMember,acceptInvitation:e.organization.acceptInvitation,rejectInvitation:e.organization.rejectInvitation,removeMember:e.organization.removeMember},admin:{listUsers:e.admin.listUsers,impersonateUser:e.admin.impersonateUser,banUser:e.admin.banUser},sso:{signIn:e.signIn.sso,register:e.sso.register},apiKey:{create:e.apiKey.create,list:e.apiKey.list,delete:e.apiKey.delete},get currentUser(){return{get profile(){return n?.user},get security(){return{mfaEnabled:n?.user?.twoFactorEnabled||!1,lastLogin:n?.user?.updatedAt,isAnonymous:n?.user?.isAnonymous||!1}},get organizations(){return{active:s,all:r}},get session(){return{id:n?.session?.id,expiresAt:n?.session?.expiresAt,userAgent:n?.session?.userAgent}}}},onAuthStateChanged(t){let a=e.useSession;return a?a.subscribe(o=>{t(o?.data?.user||null)}):()=>{}},async syncState(){let t=await e.getSession();if(n=t?.data,e.organization){let[a,o]=await Promise.all([e.organization.list(),e.organization.getActiveOrganization()]);r=a?.data,s=o?.data}return t}}},u=class{static instance=null;static config=null;static initialize(n){return this.config=n,this.instance=g(n),this.instance}static updateConfig(n){if(!this.config)throw new Error("Initialize SDK first");return this.config={...this.config,...n},this.instance=g(this.config),this.instance}static setToken(n){if(!this.config)throw new Error("Initialize SDK first");return this.updateConfig({fetchOptions:{...this.config.fetchOptions,headers:{...this.config.fetchOptions?.headers,Authorization:`Bearer ${n}`}}})}static getInstance(){if(!this.instance)throw new Error("TelestackAuth has not been initialized. Call initialize(config) first.");return this.instance}};export{u as TelestackAuth,g as createTelestackAuth};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { createAuthClient } from \"better-auth/client\";\r\nimport {\r\n magicLinkClient,\r\n organizationClient,\r\n twoFactorClient,\r\n usernameClient,\r\n multiSessionClient,\r\n jwtClient,\r\n adminClient,\r\n apiKeyClient,\r\n phoneNumberClient,\r\n emailOTPClient,\r\n oneTapClient,\r\n genericOAuthClient,\r\n oneTimeTokenClient,\r\n deviceAuthorizationClient,\r\n anonymousClient,\r\n} from \"better-auth/client/plugins\";\r\nimport { passkeyClient } from \"@better-auth/passkey/client\";\r\nimport { ssoClient } from \"@better-auth/sso/client\";\r\n\r\nexport interface TelestackConfig {\r\n url: string;\r\n tenantId: string;\r\n googleClientId?: string;\r\n fetchOptions?: any;\r\n}\r\n\r\n// Internal factory to preserve strict typing when wrapping methods\r\nexport const createTelestackAuth = (config: TelestackConfig) => {\r\n let internalSession: any = null;\r\n let internalActiveOrg: any = null;\r\n let internalOrgs: any = null;\r\n\r\n // Inlining the plugins array is MANDATORY for Better Auth strict TypeScript inference.\r\n const rawClient = createAuthClient({\r\n baseURL: `${config.url}/api/v1/${config.tenantId}/auth`,\r\n fetchOptions: config.fetchOptions,\r\n plugins: [\r\n magicLinkClient(),\r\n passkeyClient(),\r\n organizationClient(),\r\n ssoClient(),\r\n twoFactorClient(),\r\n usernameClient(),\r\n multiSessionClient(),\r\n jwtClient(),\r\n adminClient(),\r\n apiKeyClient(),\r\n phoneNumberClient(),\r\n emailOTPClient(),\r\n anonymousClient(),\r\n genericOAuthClient(),\r\n oneTimeTokenClient(),\r\n deviceAuthorizationClient(),\r\n ...(config?.googleClientId ? [oneTapClient({ clientId: config.googleClientId })] : [])\r\n ]\r\n });\r\n\r\n // Subscribe to atoms for live updates while the closure lives\r\n const sessionAtom = (rawClient as any).useSession;\r\n if (sessionAtom) {\r\n sessionAtom.subscribe((state: any) => {\r\n internalSession = state?.data;\r\n });\r\n }\r\n\r\n const activeOrgAtom = (rawClient as any).organization?.useActiveOrganization;\r\n if (activeOrgAtom) {\r\n activeOrgAtom.subscribe((state: any) => {\r\n internalActiveOrg = state?.data;\r\n });\r\n }\r\n\r\n return {\r\n rawClient,\r\n auth: {\r\n signInWithEmail: rawClient.signIn.email,\r\n signInWithUsername: rawClient.signIn.username,\r\n signInWithPhone: rawClient.signIn.phoneNumber,\r\n signInWithGoogle: (options?: Parameters<typeof rawClient.signIn.social>[0]) => rawClient.signIn.social({ provider: \"google\", ...options }),\r\n signInWithGithub: (options?: Parameters<typeof rawClient.signIn.social>[0]) => rawClient.signIn.social({ provider: \"github\", ...options }),\r\n signInWithPasskey: rawClient.signIn.passkey,\r\n signInAnonymously: rawClient.signIn.anonymous,\r\n sendMagicLink: async (options: { email: string; callbackURL?: string }) => {\r\n return await rawClient.signIn.magicLink({\r\n email: options.email,\r\n callbackURL: options.callbackURL || window.location.href,\r\n });\r\n },\r\n signInWithMagicLink: rawClient.signIn.magicLink,\r\n sendOtp: async (options: { email: string }) => {\r\n return await rawClient.emailOtp.sendVerificationOtp({\r\n email: options.email,\r\n type: \"sign-in\"\r\n });\r\n },\r\n signInWithOtp: rawClient.signIn.emailOtp,\r\n signInWithSiwe: (rawClient as any).siwe?.signIn,\r\n signUpWithEmail: rawClient.signUp.email,\r\n signOut: rawClient.signOut,\r\n verifyEmail: rawClient.verifyEmail,\r\n forgetPassword: rawClient.forgetPassword,\r\n resetPassword: rawClient.resetPassword,\r\n },\r\n mfa: {\r\n enableTwoFactor: rawClient.twoFactor.enable,\r\n disableTwoFactor: rawClient.twoFactor.disable,\r\n sendOtp: rawClient.twoFactor.sendOtp,\r\n verifyOtp: rawClient.twoFactor.verifyTotp,\r\n },\r\n user: {\r\n getSession: async () => {\r\n const res = await (rawClient.getSession() as any);\r\n internalSession = res?.data;\r\n return res;\r\n },\r\n listSessions: rawClient.listSessions,\r\n updateProfile: rawClient.updateUser,\r\n changeEmail: rawClient.changeEmail,\r\n changePassword: rawClient.changePassword,\r\n deleteAccount: rawClient.deleteUser,\r\n },\r\n organization: {\r\n create: rawClient.organization.create,\r\n update: rawClient.organization.update,\r\n setActive: rawClient.organization.setActive,\r\n list: async () => {\r\n const res = await (rawClient.organization.list() as any);\r\n internalOrgs = res?.data;\r\n return res;\r\n },\r\n inviteMember: rawClient.organization.inviteMember,\r\n acceptInvitation: rawClient.organization.acceptInvitation,\r\n rejectInvitation: rawClient.organization.rejectInvitation,\r\n removeMember: rawClient.organization.removeMember,\r\n },\r\n admin: {\r\n listUsers: rawClient.admin.listUsers,\r\n impersonateUser: rawClient.admin.impersonateUser,\r\n banUser: rawClient.admin.banUser,\r\n },\r\n sso: {\r\n signIn: rawClient.signIn.sso,\r\n register: rawClient.sso.register,\r\n },\r\n apiKey: {\r\n create: rawClient.apiKey.create,\r\n list: rawClient.apiKey.list,\r\n delete: rawClient.apiKey.delete\r\n },\r\n /**\r\n * The Advanced User Context. Provides stateful access to user attributes,\r\n * security status, and organizational roles without constant API calls.\r\n */\r\n get currentUser() {\r\n return {\r\n get profile() {\r\n return internalSession?.user;\r\n },\r\n get security() {\r\n return {\r\n mfaEnabled: internalSession?.user?.twoFactorEnabled || false,\r\n lastLogin: internalSession?.user?.updatedAt,\r\n isAnonymous: internalSession?.user?.isAnonymous || false,\r\n };\r\n },\r\n get organizations() {\r\n return {\r\n active: internalActiveOrg,\r\n all: internalOrgs,\r\n };\r\n },\r\n get session() {\r\n return {\r\n id: internalSession?.session?.id,\r\n expiresAt: internalSession?.session?.expiresAt,\r\n userAgent: internalSession?.session?.userAgent,\r\n };\r\n },\r\n };\r\n },\r\n /**\r\n * Listens for authentication state changes (sign-in, sign-out, session refresh).\r\n */\r\n onAuthStateChanged(callback: (user: any | null) => void) {\r\n const atom = (rawClient as any).useSession;\r\n if (atom) {\r\n return atom.subscribe((state: any) => {\r\n callback(state?.data?.user || null);\r\n });\r\n }\r\n return () => { };\r\n },\r\n /**\r\n * Forces a synchronization of the local auth state with the server.\r\n */\r\n async syncState() {\r\n const session = await (rawClient.getSession() as any);\r\n internalSession = session?.data;\r\n if (rawClient.organization) {\r\n const [orgs, activeOrg] = await Promise.all([\r\n (rawClient.organization as any).list(),\r\n (rawClient.organization as any).getActiveOrganization()\r\n ]);\r\n internalOrgs = (orgs as any)?.data;\r\n internalActiveOrg = (activeOrg as any)?.data;\r\n }\r\n return session;\r\n }\r\n };\r\n};\r\n\r\nexport type TelestackAuthInstance = ReturnType<typeof createTelestackAuth>;\r\n\r\n/**\r\n * The core singleton SDK for TelestackAuth.\r\n * Designed entirely for extreme developer experience and Firebase-style fluency.\r\n */\r\nexport class TelestackAuth {\r\n private static instance: TelestackAuthInstance | null = null;\r\n private static config: TelestackConfig | null = null;\r\n\r\n /**\r\n * Initializes the TelestackAuth SDK. Must be called once at app startup.\r\n */\r\n public static initialize(config: TelestackConfig): TelestackAuthInstance {\r\n this.config = config;\r\n this.instance = createTelestackAuth(config);\r\n return this.instance;\r\n }\r\n\r\n /**\r\n * Updates the SDK configuration (e.g., adding a token).\r\n */\r\n public static updateConfig(config: Partial<TelestackConfig>): TelestackAuthInstance {\r\n if (!this.config) throw new Error(\"Initialize SDK first\");\r\n this.config = { ...this.config, ...config };\r\n this.instance = createTelestackAuth(this.config);\r\n return this.instance;\r\n }\r\n\r\n /**\r\n * Sets the Bearer token for all subsequent requests.\r\n */\r\n public static setToken(token: string): TelestackAuthInstance {\r\n if (!this.config) throw new Error(\"Initialize SDK first\");\r\n return this.updateConfig({\r\n fetchOptions: {\r\n ...this.config.fetchOptions,\r\n headers: {\r\n ...this.config.fetchOptions?.headers,\r\n \"Authorization\": `Bearer ${token}`\r\n }\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Retrieves the initialized instance of the SDK.\r\n */\r\n public static getInstance(): TelestackAuthInstance {\r\n if (!this.instance) {\r\n throw new Error(\"TelestackAuth has not been initialized. Call initialize(config) first.\");\r\n }\r\n return this.instance;\r\n }\r\n}\r\n\r\n"],"mappings":"AAAA,OAAS,oBAAAA,MAAwB,qBACjC,OACI,mBAAAC,EACA,sBAAAC,EACA,mBAAAC,EACA,kBAAAC,EACA,sBAAAC,EACA,aAAAC,EACA,eAAAC,EACA,gBAAAC,EACA,qBAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,sBAAAC,EACA,sBAAAC,EACA,6BAAAC,EACA,mBAAAC,MACG,6BACP,OAAS,iBAAAC,MAAqB,8BAC9B,OAAS,aAAAC,MAAiB,0BAUnB,IAAMC,EAAuBC,GAA4B,CAC5D,IAAIC,EAAuB,KACvBC,EAAyB,KACzBC,EAAoB,KAGlBC,EAAYvB,EAAiB,CAC/B,QAAS,GAAGmB,EAAO,GAAG,WAAWA,EAAO,QAAQ,QAChD,aAAcA,EAAO,aACrB,QAAS,CACLlB,EAAgB,EAChBe,EAAc,EACdd,EAAmB,EACnBe,EAAU,EACVd,EAAgB,EAChBC,EAAe,EACfC,EAAmB,EACnBC,EAAU,EACVC,EAAY,EACZC,EAAa,EACbC,EAAkB,EAClBC,EAAe,EACfK,EAAgB,EAChBH,EAAmB,EACnBC,EAAmB,EACnBC,EAA0B,EAC1B,GAAIK,GAAQ,eAAiB,CAACR,EAAa,CAAE,SAAUQ,EAAO,cAAe,CAAC,CAAC,EAAI,CAAC,CACxF,CACJ,CAAC,EAGKK,EAAeD,EAAkB,WACnCC,GACAA,EAAY,UAAWC,GAAe,CAClCL,EAAkBK,GAAO,IAC7B,CAAC,EAGL,IAAMC,EAAiBH,EAAkB,cAAc,sBACvD,OAAIG,GACAA,EAAc,UAAWD,GAAe,CACpCJ,EAAoBI,GAAO,IAC/B,CAAC,EAGE,CACH,UAAAF,EACA,KAAM,C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X,CACJ,CACJ,EAQaG,EAAN,KAAoB,CACvB,OAAe,SAAyC,KACxD,OAAe,OAAiC,KAKhD,OAAc,WAAWf,EAAgD,CACrE,YAAK,OAASA,EACd,KAAK,SAAWD,EAAoBC,CAAM,EACnC,KAAK,QAChB,CAKA,OAAc,aAAaA,EAAyD,CAChF,GAAI,CAAC,KAAK,OAAQ,MAAM,IAAI,MAAM,sBAAsB,EACxD,YAAK,OAAS,CAAE,GAAG,KAAK,OAAQ,GAAGA,CAAO,EAC1C,KAAK,SAAWD,EAAoB,KAAK,MAAM,EACxC,KAAK,QAChB,CAKA,OAAc,SAASiB,EAAsC,CACzD,GAAI,CAAC,KAAK,OAAQ,MAAM,IAAI,MAAM,sBAAsB,EACxD,OAAO,KAAK,aAAa,CACrB,aAAc,CACV,GAAG,KAAK,OAAO,aACf,QAAS,CACL,GAAG,KAAK,OAAO,cAAc,QAC7B,cAAiB,UAAUA,CAAK,EACpC,CACJ,CACJ,CAAC,CACL,CAKA,OAAc,aAAqC,CAC/C,GAAI,CAAC,KAAK,SACN,MAAM,IAAI,MAAM,wEAAwE,EAE5F,OAAO,KAAK,QAChB,CACJ","names":["createAuthClient","magicLinkClient","organizationClient","twoFactorClient","usernameClient","multiSessionClient","jwtClient","adminClient","apiKeyClient","phoneNumberClient","emailOTPClient","oneTapClient","genericOAuthClient","oneTimeTokenClient","deviceAuthorizationClient","anonymousClient","passkeyClient","ssoClient","createTelestackAuth","config","internalSession","internalActiveOrg","internalOrgs","rawClient","sessionAtom","state","activeOrgAtom","options","res","callback","atom","session","orgs","activeOrg","TelestackAuth","token"]}
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@telestack/auth-sdk",
3
+ "version": "1.0.0",
4
+ "description": "Firebase-style fluent SDK for TelestackAuth",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "scripts": {
9
+ "build": "tsup",
10
+ "dev": "tsup --watch"
11
+ },
12
+ "keywords": [],
13
+ "author": "",
14
+ "license": "ISC",
15
+ "dependencies": {
16
+ "@better-auth/passkey": "^1.4.20",
17
+ "@better-auth/sso": "^1.4.20",
18
+ "better-auth": "^1.4.20"
19
+ },
20
+ "devDependencies": {
21
+ "tsup": "^8.5.1",
22
+ "typescript": "^5.9.3"
23
+ }
24
+ }