@drmhse/sso-sdk 0.3.4 → 0.3.5

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,9 +1,9 @@
1
- # AuthOS SDK
1
+ # [AuthOS](https://authos.dev) SDK
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@drmhse/sso-sdk)](https://www.npmjs.com/package/@drmhse/sso-sdk)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
5
 
6
- A zero-dependency, strongly-typed TypeScript SDK for AuthOS, the multi-tenant authentication platform.
6
+ A zero-dependency, strongly-typed TypeScript SDK for [AuthOS](https://authos.dev), the multi-tenant authentication platform.
7
7
 
8
8
  **[View Full Documentation →](https://drmhse.com/docs/sso/)**
9
9
 
@@ -331,7 +331,7 @@ sso.onAuthStateChange((isAuthenticated) => {
331
331
 
332
332
  ## Platform Administration
333
333
 
334
- For platform owners managing AuthOS:
334
+ For platform owners managing [AuthOS](https://authos.dev):
335
335
 
336
336
  ```typescript
337
337
  // Approve pending organization
@@ -383,7 +383,7 @@ const login = async (credentials: LoginPayload): Promise<RefreshTokenResponse> =
383
383
 
384
384
  ## Validating JWTs in Your Backend
385
385
 
386
- AuthOS uses RS256 (asymmetric) JWT signing. Your backend can validate tokens without sharing secrets:
386
+ [AuthOS](https://authos.dev) uses RS256 (asymmetric) JWT signing. Your backend can validate tokens without sharing secrets:
387
387
 
388
388
  ```typescript
389
389
  // Fetch JWKS from the SSO platform
package/dist/index.d.mts CHANGED
@@ -23,6 +23,31 @@ declare class BrowserStorage implements TokenStorage {
23
23
  setItem(key: string, value: string): void;
24
24
  removeItem(key: string): void;
25
25
  }
26
+ /**
27
+ * Browser Cookie adapter for SSR frameworks (Next.js, Nuxt, etc.)
28
+ *
29
+ * Uses document.cookie for client-side access. Works with server-side
30
+ * middleware that can read the same cookies.
31
+ *
32
+ * For Next.js App Router, pair this with cookies() from 'next/headers'
33
+ * in server components to pass the initial token.
34
+ */
35
+ declare class CookieStorage implements TokenStorage {
36
+ private options;
37
+ constructor(options?: {
38
+ domain?: string;
39
+ path?: string;
40
+ secure?: boolean;
41
+ sameSite?: 'strict' | 'lax' | 'none';
42
+ maxAge?: number;
43
+ });
44
+ private getCookie;
45
+ private setCookie;
46
+ private deleteCookie;
47
+ getItem(key: string): string | null;
48
+ setItem(key: string, value: string): void;
49
+ removeItem(key: string): void;
50
+ }
26
51
 
27
52
  /**
28
53
  * Common types used across the SDK
@@ -5716,4 +5741,4 @@ declare class SsoApiError extends Error {
5716
5741
  isNotFound(): boolean;
5717
5742
  }
5718
5743
 
5719
- export { type AcceptInvitationPayload, type AdminLoginUrlParams, type AnalyticsQuery, type ApiKey, type ApiKeyCreateResponse, type ApproveOrganizationPayload, type AuditLog, type AuditLogEntry, type AuditLogQueryParams, type AuditLogResponse, AuthErrorCodes, AuthMethod, AuthModule, type AuthSnapshot, type AuthenticationResponseJSON, type BackupCodesResponse, type BrandingConfiguration, BrowserStorage, type ChangePasswordRequest, type ChangePasswordResponse, type ConfigureSamlPayload, type ConfigureSamlResponse, type CreateApiKeyPayload, type CreateCheckoutPayload, type CreateCheckoutResponse, type CreateInvitationPayload, type CreateOrganizationPayload, type CreateOrganizationResponse, type CreatePlanPayload, type CreateScimTokenRequest, type CreateServicePayload, type CreateServiceResponse, type CreateSiemConfigRequest, type CreateWebhookRequest, type DeclineInvitationPayload, type DeviceCodeRequest, type DeviceCodeResponse, type DeviceTrust, type DeviceVerifyResponse, type DomainConfiguration, type DomainVerificationMethod, type DomainVerificationResponse, type DomainVerificationResult, type EndUser, type EndUserDetailResponse, type EndUserIdentity, type EndUserListResponse, type EndUserSubscription, type EventTypeInfo, type ExportUserDataResponse, type ForgetUserResponse, type ForgotPasswordRequest, type ForgotPasswordResponse, type GeolocationData, type GetAuditLogParams, type GetRiskSettingsResponse, type GrowthTrendPoint, type Identity, type ImpersonateRequest, type ImpersonateResponse, type ImpersonationUserInfo, type Invitation, type InvitationStatus, type InvitationWithOrg, InvitationsModule, type JwtClaims, type ListApiKeysResponse, type ListDevicesResponse, type ListEndUsersParams, type ListOrganizationsParams, type ListPlatformOrganizationsParams, type ListScimTokensResponse, type ListSiemConfigsResponse, type LoginActivityPoint, type LoginEventExport, type LoginRequest, type LoginTrendPoint, type LoginUrlParams, type LoginsByProvider, type LoginsByService, type LookupEmailRequest, type LookupEmailResponse, MagicLinks, type MemberListResponse, type MemberRole, type Membership, type MembershipExport, MemoryStorage, type MfaEventExport, type MfaSetupResponse, type MfaStatusResponse, type MfaVerificationRequest, type MfaVerificationResponse, type MfaVerifyRequest, type MfaVerifyResponse, type OAuthCredentials, type OAuthIdentityExport, type OAuthProvider, type Organization, type OrganizationMember, type OrganizationResponse, type OrganizationStatus, type OrganizationStatusBreakdown, type OrganizationTier, OrganizationsModule, type PaginatedResponse, type PaginationInfo, type PaginationParams, type Passkey, type PasskeyAuthFinishRequest, type PasskeyAuthFinishResponse, type PasskeyAuthStartRequest, type PasskeyAuthStartResponse, type PasskeyExport, type PasskeyRegisterFinishRequest, type PasskeyRegisterFinishResponse, type PasskeyRegisterStartRequest, type PasskeyRegisterStartResponse, PasskeysModule, PermissionsModule, type Plan, type PlanResponse, type PlatformAnalyticsDateRangeParams, PlatformModule, type PlatformOrganizationResponse, type PlatformOrganizationsListResponse, type PlatformOverviewMetrics, type PromotePlatformOwnerPayload, type ProviderToken, type ProviderTokenGrant, type RecentLogin, type RecentOrganization, type RefreshTokenRequest, type RefreshTokenResponse, type RegisterRequest, type RegisterResponse, type RegistrationResponseJSON, type RejectOrganizationPayload, type ResetPasswordRequest, type ResetPasswordResponse, type RevokeDeviceRequest, type RevokeDeviceResponse, type RevokeSessionsResponse, RiskAction, type RiskAnalytics, type RiskAssessment, type RiskContext, type RiskEnforcementMode, type RiskEngineConfig, type RiskEvent, RiskEventOutcome, type RiskFactor, RiskFactorType, type RiskRule, type RiskRuleCondition, type RiskScore, type RiskSettings, type SamlCertificate, type SamlConfig, type ScimTokenResponse, type Service, ServiceApiModule, type ServiceListResponse, type ServiceResponse, type ServiceType, type ServiceWithDetails, ServicesModule, type SetCustomDomainRequest, type SetOAuthCredentialsPayload, type SetPasswordRequest, type SetPasswordResponse, type SetSmtpRequest, type SiemConfigResponse, type SiemProviderType, type SmtpConfigResponse, SsoApiError, SsoClient, type SsoClientOptions, type StartLinkResponse, type Subscription, type TestConnectionResponse, type TokenRequest, type TokenResponse, type TokenStorage, type TopOrganization, type TransferOwnershipPayload, type UpdateBrandingRequest, type UpdateMemberRolePayload, type UpdateOrganizationPayload, type UpdateOrganizationTierPayload, type UpdatePlanPayload, type UpdateRiskSettingsRequest, type UpdateRiskSettingsResponse, type UpdateServicePayload, type UpdateSiemConfigRequest, type UpdateUserProfilePayload, type UpdateWebhookRequest, type User, type UserDevice, UserModule, type UserProfile, type Webhook, type WebhookDelivery, type WebhookDeliveryListResponse, type WebhookDeliveryQueryParams, type WebhookListResponse, type WebhookResponse };
5744
+ export { type AcceptInvitationPayload, type AdminLoginUrlParams, type AnalyticsQuery, type ApiKey, type ApiKeyCreateResponse, type ApproveOrganizationPayload, type AuditLog, type AuditLogEntry, type AuditLogQueryParams, type AuditLogResponse, AuthErrorCodes, AuthMethod, AuthModule, type AuthSnapshot, type AuthenticationResponseJSON, type BackupCodesResponse, type BrandingConfiguration, BrowserStorage, type ChangePasswordRequest, type ChangePasswordResponse, type ConfigureSamlPayload, type ConfigureSamlResponse, CookieStorage, type CreateApiKeyPayload, type CreateCheckoutPayload, type CreateCheckoutResponse, type CreateInvitationPayload, type CreateOrganizationPayload, type CreateOrganizationResponse, type CreatePlanPayload, type CreateScimTokenRequest, type CreateServicePayload, type CreateServiceResponse, type CreateSiemConfigRequest, type CreateWebhookRequest, type DeclineInvitationPayload, type DeviceCodeRequest, type DeviceCodeResponse, type DeviceTrust, type DeviceVerifyResponse, type DomainConfiguration, type DomainVerificationMethod, type DomainVerificationResponse, type DomainVerificationResult, type EndUser, type EndUserDetailResponse, type EndUserIdentity, type EndUserListResponse, type EndUserSubscription, type EventTypeInfo, type ExportUserDataResponse, type ForgetUserResponse, type ForgotPasswordRequest, type ForgotPasswordResponse, type GeolocationData, type GetAuditLogParams, type GetRiskSettingsResponse, type GrowthTrendPoint, type Identity, type ImpersonateRequest, type ImpersonateResponse, type ImpersonationUserInfo, type Invitation, type InvitationStatus, type InvitationWithOrg, InvitationsModule, type JwtClaims, type ListApiKeysResponse, type ListDevicesResponse, type ListEndUsersParams, type ListOrganizationsParams, type ListPlatformOrganizationsParams, type ListScimTokensResponse, type ListSiemConfigsResponse, type LoginActivityPoint, type LoginEventExport, type LoginRequest, type LoginTrendPoint, type LoginUrlParams, type LoginsByProvider, type LoginsByService, type LookupEmailRequest, type LookupEmailResponse, MagicLinks, type MemberListResponse, type MemberRole, type Membership, type MembershipExport, MemoryStorage, type MfaEventExport, type MfaSetupResponse, type MfaStatusResponse, type MfaVerificationRequest, type MfaVerificationResponse, type MfaVerifyRequest, type MfaVerifyResponse, type OAuthCredentials, type OAuthIdentityExport, type OAuthProvider, type Organization, type OrganizationMember, type OrganizationResponse, type OrganizationStatus, type OrganizationStatusBreakdown, type OrganizationTier, OrganizationsModule, type PaginatedResponse, type PaginationInfo, type PaginationParams, type Passkey, type PasskeyAuthFinishRequest, type PasskeyAuthFinishResponse, type PasskeyAuthStartRequest, type PasskeyAuthStartResponse, type PasskeyExport, type PasskeyRegisterFinishRequest, type PasskeyRegisterFinishResponse, type PasskeyRegisterStartRequest, type PasskeyRegisterStartResponse, PasskeysModule, PermissionsModule, type Plan, type PlanResponse, type PlatformAnalyticsDateRangeParams, PlatformModule, type PlatformOrganizationResponse, type PlatformOrganizationsListResponse, type PlatformOverviewMetrics, type PromotePlatformOwnerPayload, type ProviderToken, type ProviderTokenGrant, type RecentLogin, type RecentOrganization, type RefreshTokenRequest, type RefreshTokenResponse, type RegisterRequest, type RegisterResponse, type RegistrationResponseJSON, type RejectOrganizationPayload, type ResetPasswordRequest, type ResetPasswordResponse, type RevokeDeviceRequest, type RevokeDeviceResponse, type RevokeSessionsResponse, RiskAction, type RiskAnalytics, type RiskAssessment, type RiskContext, type RiskEnforcementMode, type RiskEngineConfig, type RiskEvent, RiskEventOutcome, type RiskFactor, RiskFactorType, type RiskRule, type RiskRuleCondition, type RiskScore, type RiskSettings, type SamlCertificate, type SamlConfig, type ScimTokenResponse, type Service, ServiceApiModule, type ServiceListResponse, type ServiceResponse, type ServiceType, type ServiceWithDetails, ServicesModule, type SetCustomDomainRequest, type SetOAuthCredentialsPayload, type SetPasswordRequest, type SetPasswordResponse, type SetSmtpRequest, type SiemConfigResponse, type SiemProviderType, type SmtpConfigResponse, SsoApiError, SsoClient, type SsoClientOptions, type StartLinkResponse, type Subscription, type TestConnectionResponse, type TokenRequest, type TokenResponse, type TokenStorage, type TopOrganization, type TransferOwnershipPayload, type UpdateBrandingRequest, type UpdateMemberRolePayload, type UpdateOrganizationPayload, type UpdateOrganizationTierPayload, type UpdatePlanPayload, type UpdateRiskSettingsRequest, type UpdateRiskSettingsResponse, type UpdateServicePayload, type UpdateSiemConfigRequest, type UpdateUserProfilePayload, type UpdateWebhookRequest, type User, type UserDevice, UserModule, type UserProfile, type Webhook, type WebhookDelivery, type WebhookDeliveryListResponse, type WebhookDeliveryQueryParams, type WebhookListResponse, type WebhookResponse };
package/dist/index.d.ts CHANGED
@@ -23,6 +23,31 @@ declare class BrowserStorage implements TokenStorage {
23
23
  setItem(key: string, value: string): void;
24
24
  removeItem(key: string): void;
25
25
  }
26
+ /**
27
+ * Browser Cookie adapter for SSR frameworks (Next.js, Nuxt, etc.)
28
+ *
29
+ * Uses document.cookie for client-side access. Works with server-side
30
+ * middleware that can read the same cookies.
31
+ *
32
+ * For Next.js App Router, pair this with cookies() from 'next/headers'
33
+ * in server components to pass the initial token.
34
+ */
35
+ declare class CookieStorage implements TokenStorage {
36
+ private options;
37
+ constructor(options?: {
38
+ domain?: string;
39
+ path?: string;
40
+ secure?: boolean;
41
+ sameSite?: 'strict' | 'lax' | 'none';
42
+ maxAge?: number;
43
+ });
44
+ private getCookie;
45
+ private setCookie;
46
+ private deleteCookie;
47
+ getItem(key: string): string | null;
48
+ setItem(key: string, value: string): void;
49
+ removeItem(key: string): void;
50
+ }
26
51
 
27
52
  /**
28
53
  * Common types used across the SDK
@@ -5716,4 +5741,4 @@ declare class SsoApiError extends Error {
5716
5741
  isNotFound(): boolean;
5717
5742
  }
5718
5743
 
5719
- export { type AcceptInvitationPayload, type AdminLoginUrlParams, type AnalyticsQuery, type ApiKey, type ApiKeyCreateResponse, type ApproveOrganizationPayload, type AuditLog, type AuditLogEntry, type AuditLogQueryParams, type AuditLogResponse, AuthErrorCodes, AuthMethod, AuthModule, type AuthSnapshot, type AuthenticationResponseJSON, type BackupCodesResponse, type BrandingConfiguration, BrowserStorage, type ChangePasswordRequest, type ChangePasswordResponse, type ConfigureSamlPayload, type ConfigureSamlResponse, type CreateApiKeyPayload, type CreateCheckoutPayload, type CreateCheckoutResponse, type CreateInvitationPayload, type CreateOrganizationPayload, type CreateOrganizationResponse, type CreatePlanPayload, type CreateScimTokenRequest, type CreateServicePayload, type CreateServiceResponse, type CreateSiemConfigRequest, type CreateWebhookRequest, type DeclineInvitationPayload, type DeviceCodeRequest, type DeviceCodeResponse, type DeviceTrust, type DeviceVerifyResponse, type DomainConfiguration, type DomainVerificationMethod, type DomainVerificationResponse, type DomainVerificationResult, type EndUser, type EndUserDetailResponse, type EndUserIdentity, type EndUserListResponse, type EndUserSubscription, type EventTypeInfo, type ExportUserDataResponse, type ForgetUserResponse, type ForgotPasswordRequest, type ForgotPasswordResponse, type GeolocationData, type GetAuditLogParams, type GetRiskSettingsResponse, type GrowthTrendPoint, type Identity, type ImpersonateRequest, type ImpersonateResponse, type ImpersonationUserInfo, type Invitation, type InvitationStatus, type InvitationWithOrg, InvitationsModule, type JwtClaims, type ListApiKeysResponse, type ListDevicesResponse, type ListEndUsersParams, type ListOrganizationsParams, type ListPlatformOrganizationsParams, type ListScimTokensResponse, type ListSiemConfigsResponse, type LoginActivityPoint, type LoginEventExport, type LoginRequest, type LoginTrendPoint, type LoginUrlParams, type LoginsByProvider, type LoginsByService, type LookupEmailRequest, type LookupEmailResponse, MagicLinks, type MemberListResponse, type MemberRole, type Membership, type MembershipExport, MemoryStorage, type MfaEventExport, type MfaSetupResponse, type MfaStatusResponse, type MfaVerificationRequest, type MfaVerificationResponse, type MfaVerifyRequest, type MfaVerifyResponse, type OAuthCredentials, type OAuthIdentityExport, type OAuthProvider, type Organization, type OrganizationMember, type OrganizationResponse, type OrganizationStatus, type OrganizationStatusBreakdown, type OrganizationTier, OrganizationsModule, type PaginatedResponse, type PaginationInfo, type PaginationParams, type Passkey, type PasskeyAuthFinishRequest, type PasskeyAuthFinishResponse, type PasskeyAuthStartRequest, type PasskeyAuthStartResponse, type PasskeyExport, type PasskeyRegisterFinishRequest, type PasskeyRegisterFinishResponse, type PasskeyRegisterStartRequest, type PasskeyRegisterStartResponse, PasskeysModule, PermissionsModule, type Plan, type PlanResponse, type PlatformAnalyticsDateRangeParams, PlatformModule, type PlatformOrganizationResponse, type PlatformOrganizationsListResponse, type PlatformOverviewMetrics, type PromotePlatformOwnerPayload, type ProviderToken, type ProviderTokenGrant, type RecentLogin, type RecentOrganization, type RefreshTokenRequest, type RefreshTokenResponse, type RegisterRequest, type RegisterResponse, type RegistrationResponseJSON, type RejectOrganizationPayload, type ResetPasswordRequest, type ResetPasswordResponse, type RevokeDeviceRequest, type RevokeDeviceResponse, type RevokeSessionsResponse, RiskAction, type RiskAnalytics, type RiskAssessment, type RiskContext, type RiskEnforcementMode, type RiskEngineConfig, type RiskEvent, RiskEventOutcome, type RiskFactor, RiskFactorType, type RiskRule, type RiskRuleCondition, type RiskScore, type RiskSettings, type SamlCertificate, type SamlConfig, type ScimTokenResponse, type Service, ServiceApiModule, type ServiceListResponse, type ServiceResponse, type ServiceType, type ServiceWithDetails, ServicesModule, type SetCustomDomainRequest, type SetOAuthCredentialsPayload, type SetPasswordRequest, type SetPasswordResponse, type SetSmtpRequest, type SiemConfigResponse, type SiemProviderType, type SmtpConfigResponse, SsoApiError, SsoClient, type SsoClientOptions, type StartLinkResponse, type Subscription, type TestConnectionResponse, type TokenRequest, type TokenResponse, type TokenStorage, type TopOrganization, type TransferOwnershipPayload, type UpdateBrandingRequest, type UpdateMemberRolePayload, type UpdateOrganizationPayload, type UpdateOrganizationTierPayload, type UpdatePlanPayload, type UpdateRiskSettingsRequest, type UpdateRiskSettingsResponse, type UpdateServicePayload, type UpdateSiemConfigRequest, type UpdateUserProfilePayload, type UpdateWebhookRequest, type User, type UserDevice, UserModule, type UserProfile, type Webhook, type WebhookDelivery, type WebhookDeliveryListResponse, type WebhookDeliveryQueryParams, type WebhookListResponse, type WebhookResponse };
5744
+ export { type AcceptInvitationPayload, type AdminLoginUrlParams, type AnalyticsQuery, type ApiKey, type ApiKeyCreateResponse, type ApproveOrganizationPayload, type AuditLog, type AuditLogEntry, type AuditLogQueryParams, type AuditLogResponse, AuthErrorCodes, AuthMethod, AuthModule, type AuthSnapshot, type AuthenticationResponseJSON, type BackupCodesResponse, type BrandingConfiguration, BrowserStorage, type ChangePasswordRequest, type ChangePasswordResponse, type ConfigureSamlPayload, type ConfigureSamlResponse, CookieStorage, type CreateApiKeyPayload, type CreateCheckoutPayload, type CreateCheckoutResponse, type CreateInvitationPayload, type CreateOrganizationPayload, type CreateOrganizationResponse, type CreatePlanPayload, type CreateScimTokenRequest, type CreateServicePayload, type CreateServiceResponse, type CreateSiemConfigRequest, type CreateWebhookRequest, type DeclineInvitationPayload, type DeviceCodeRequest, type DeviceCodeResponse, type DeviceTrust, type DeviceVerifyResponse, type DomainConfiguration, type DomainVerificationMethod, type DomainVerificationResponse, type DomainVerificationResult, type EndUser, type EndUserDetailResponse, type EndUserIdentity, type EndUserListResponse, type EndUserSubscription, type EventTypeInfo, type ExportUserDataResponse, type ForgetUserResponse, type ForgotPasswordRequest, type ForgotPasswordResponse, type GeolocationData, type GetAuditLogParams, type GetRiskSettingsResponse, type GrowthTrendPoint, type Identity, type ImpersonateRequest, type ImpersonateResponse, type ImpersonationUserInfo, type Invitation, type InvitationStatus, type InvitationWithOrg, InvitationsModule, type JwtClaims, type ListApiKeysResponse, type ListDevicesResponse, type ListEndUsersParams, type ListOrganizationsParams, type ListPlatformOrganizationsParams, type ListScimTokensResponse, type ListSiemConfigsResponse, type LoginActivityPoint, type LoginEventExport, type LoginRequest, type LoginTrendPoint, type LoginUrlParams, type LoginsByProvider, type LoginsByService, type LookupEmailRequest, type LookupEmailResponse, MagicLinks, type MemberListResponse, type MemberRole, type Membership, type MembershipExport, MemoryStorage, type MfaEventExport, type MfaSetupResponse, type MfaStatusResponse, type MfaVerificationRequest, type MfaVerificationResponse, type MfaVerifyRequest, type MfaVerifyResponse, type OAuthCredentials, type OAuthIdentityExport, type OAuthProvider, type Organization, type OrganizationMember, type OrganizationResponse, type OrganizationStatus, type OrganizationStatusBreakdown, type OrganizationTier, OrganizationsModule, type PaginatedResponse, type PaginationInfo, type PaginationParams, type Passkey, type PasskeyAuthFinishRequest, type PasskeyAuthFinishResponse, type PasskeyAuthStartRequest, type PasskeyAuthStartResponse, type PasskeyExport, type PasskeyRegisterFinishRequest, type PasskeyRegisterFinishResponse, type PasskeyRegisterStartRequest, type PasskeyRegisterStartResponse, PasskeysModule, PermissionsModule, type Plan, type PlanResponse, type PlatformAnalyticsDateRangeParams, PlatformModule, type PlatformOrganizationResponse, type PlatformOrganizationsListResponse, type PlatformOverviewMetrics, type PromotePlatformOwnerPayload, type ProviderToken, type ProviderTokenGrant, type RecentLogin, type RecentOrganization, type RefreshTokenRequest, type RefreshTokenResponse, type RegisterRequest, type RegisterResponse, type RegistrationResponseJSON, type RejectOrganizationPayload, type ResetPasswordRequest, type ResetPasswordResponse, type RevokeDeviceRequest, type RevokeDeviceResponse, type RevokeSessionsResponse, RiskAction, type RiskAnalytics, type RiskAssessment, type RiskContext, type RiskEnforcementMode, type RiskEngineConfig, type RiskEvent, RiskEventOutcome, type RiskFactor, RiskFactorType, type RiskRule, type RiskRuleCondition, type RiskScore, type RiskSettings, type SamlCertificate, type SamlConfig, type ScimTokenResponse, type Service, ServiceApiModule, type ServiceListResponse, type ServiceResponse, type ServiceType, type ServiceWithDetails, ServicesModule, type SetCustomDomainRequest, type SetOAuthCredentialsPayload, type SetPasswordRequest, type SetPasswordResponse, type SetSmtpRequest, type SiemConfigResponse, type SiemProviderType, type SmtpConfigResponse, SsoApiError, SsoClient, type SsoClientOptions, type StartLinkResponse, type Subscription, type TestConnectionResponse, type TokenRequest, type TokenResponse, type TokenStorage, type TopOrganization, type TransferOwnershipPayload, type UpdateBrandingRequest, type UpdateMemberRolePayload, type UpdateOrganizationPayload, type UpdateOrganizationTierPayload, type UpdatePlanPayload, type UpdateRiskSettingsRequest, type UpdateRiskSettingsResponse, type UpdateServicePayload, type UpdateSiemConfigRequest, type UpdateUserProfilePayload, type UpdateWebhookRequest, type User, type UserDevice, UserModule, type UserProfile, type Webhook, type WebhookDelivery, type WebhookDeliveryListResponse, type WebhookDeliveryQueryParams, type WebhookListResponse, type WebhookResponse };
package/dist/index.js CHANGED
@@ -24,6 +24,7 @@ __export(index_exports, {
24
24
  AuthMethod: () => AuthMethod,
25
25
  AuthModule: () => AuthModule,
26
26
  BrowserStorage: () => BrowserStorage,
27
+ CookieStorage: () => CookieStorage,
27
28
  InvitationsModule: () => InvitationsModule,
28
29
  MagicLinks: () => MagicLinks,
29
30
  MemoryStorage: () => MemoryStorage,
@@ -409,6 +410,60 @@ var BrowserStorage = class {
409
410
  if (typeof window !== "undefined") window.localStorage.removeItem(key);
410
411
  }
411
412
  };
413
+ var CookieStorage = class {
414
+ constructor(options = {}) {
415
+ this.options = options;
416
+ }
417
+ getCookie(name) {
418
+ if (typeof window === "undefined") return null;
419
+ const value = `; ${document.cookie}`;
420
+ const parts = value.split(`; ${name}=`);
421
+ if (parts.length === 2) {
422
+ return parts.pop()?.split(";").shift() || null;
423
+ }
424
+ return null;
425
+ }
426
+ setCookie(name, value) {
427
+ if (typeof window === "undefined") return;
428
+ let cookie = `${name}=${value}`;
429
+ if (this.options.path) {
430
+ cookie += `; Path=${this.options.path}`;
431
+ }
432
+ if (this.options.domain) {
433
+ cookie += `; Domain=${this.options.domain}`;
434
+ }
435
+ if (this.options.secure !== false) {
436
+ cookie += "; Secure";
437
+ }
438
+ if (this.options.sameSite ?? "lax") {
439
+ cookie += `; SameSite=${this.options.sameSite ?? "lax"}`;
440
+ }
441
+ if (this.options.maxAge) {
442
+ cookie += `; Max-Age=${this.options.maxAge}`;
443
+ }
444
+ document.cookie = cookie;
445
+ }
446
+ deleteCookie(name) {
447
+ if (typeof window === "undefined") return;
448
+ let cookie = `${name}=; Expires=Thu, 01 Jan 1970 00:00:00 GMT`;
449
+ if (this.options.path) {
450
+ cookie += `; Path=${this.options.path}`;
451
+ }
452
+ if (this.options.domain) {
453
+ cookie += `; Domain=${this.options.domain}`;
454
+ }
455
+ document.cookie = cookie;
456
+ }
457
+ getItem(key) {
458
+ return this.getCookie(key);
459
+ }
460
+ setItem(key, value) {
461
+ this.setCookie(key, value);
462
+ }
463
+ removeItem(key) {
464
+ this.deleteCookie(key);
465
+ }
466
+ };
412
467
  function resolveStorage(userStorage) {
413
468
  if (userStorage) return userStorage;
414
469
  if (typeof window !== "undefined" && window.localStorage) return new BrowserStorage();
@@ -4617,6 +4672,7 @@ var RiskEventOutcome = /* @__PURE__ */ ((RiskEventOutcome2) => {
4617
4672
  AuthMethod,
4618
4673
  AuthModule,
4619
4674
  BrowserStorage,
4675
+ CookieStorage,
4620
4676
  InvitationsModule,
4621
4677
  MagicLinks,
4622
4678
  MemoryStorage,
package/dist/index.mjs CHANGED
@@ -365,6 +365,60 @@ var BrowserStorage = class {
365
365
  if (typeof window !== "undefined") window.localStorage.removeItem(key);
366
366
  }
367
367
  };
368
+ var CookieStorage = class {
369
+ constructor(options = {}) {
370
+ this.options = options;
371
+ }
372
+ getCookie(name) {
373
+ if (typeof window === "undefined") return null;
374
+ const value = `; ${document.cookie}`;
375
+ const parts = value.split(`; ${name}=`);
376
+ if (parts.length === 2) {
377
+ return parts.pop()?.split(";").shift() || null;
378
+ }
379
+ return null;
380
+ }
381
+ setCookie(name, value) {
382
+ if (typeof window === "undefined") return;
383
+ let cookie = `${name}=${value}`;
384
+ if (this.options.path) {
385
+ cookie += `; Path=${this.options.path}`;
386
+ }
387
+ if (this.options.domain) {
388
+ cookie += `; Domain=${this.options.domain}`;
389
+ }
390
+ if (this.options.secure !== false) {
391
+ cookie += "; Secure";
392
+ }
393
+ if (this.options.sameSite ?? "lax") {
394
+ cookie += `; SameSite=${this.options.sameSite ?? "lax"}`;
395
+ }
396
+ if (this.options.maxAge) {
397
+ cookie += `; Max-Age=${this.options.maxAge}`;
398
+ }
399
+ document.cookie = cookie;
400
+ }
401
+ deleteCookie(name) {
402
+ if (typeof window === "undefined") return;
403
+ let cookie = `${name}=; Expires=Thu, 01 Jan 1970 00:00:00 GMT`;
404
+ if (this.options.path) {
405
+ cookie += `; Path=${this.options.path}`;
406
+ }
407
+ if (this.options.domain) {
408
+ cookie += `; Domain=${this.options.domain}`;
409
+ }
410
+ document.cookie = cookie;
411
+ }
412
+ getItem(key) {
413
+ return this.getCookie(key);
414
+ }
415
+ setItem(key, value) {
416
+ this.setCookie(key, value);
417
+ }
418
+ removeItem(key) {
419
+ this.deleteCookie(key);
420
+ }
421
+ };
368
422
  function resolveStorage(userStorage) {
369
423
  if (userStorage) return userStorage;
370
424
  if (typeof window !== "undefined" && window.localStorage) return new BrowserStorage();
@@ -4572,6 +4626,7 @@ export {
4572
4626
  AuthMethod,
4573
4627
  AuthModule,
4574
4628
  BrowserStorage,
4629
+ CookieStorage,
4575
4630
  InvitationsModule,
4576
4631
  MagicLinks,
4577
4632
  MemoryStorage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drmhse/sso-sdk",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Zero-dependency TypeScript SDK for AuthOS, the multi-tenant authentication platform",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",