diff --git a/.changeset/docs-native-session-deadlines.md b/.changeset/docs-native-session-deadlines.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/docs-native-session-deadlines.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/packages/backend/src/api/resources/Session.ts b/packages/backend/src/api/resources/Session.ts index 968be156748..cb52f230154 100644 --- a/packages/backend/src/api/resources/Session.ts +++ b/packages/backend/src/api/resources/Session.ts @@ -52,9 +52,13 @@ export class Session { readonly status: string, /** The time the session was last active on the [`Client`](https://clerk.com/docs/reference/backend/types/backend-client). */ readonly lastActiveAt: number, - /** The Unix timestamp when the `Session` will expire. */ + /** + * The Unix timestamp when the `Session` will expire. For an [indefinite native session](https://clerk.com/docs/guides/secure/session-options#native-sessions), this is `0`, meaning no expiration deadline. Check `status` to determine whether the session is active. + */ readonly expireAt: number, - /** The Unix timestamp when the `Session` will be abandoned. */ + /** + * The Unix timestamp when the `Session` will be abandoned. For an [indefinite native session](https://clerk.com/docs/guides/secure/session-options#native-sessions), this is `0`, meaning no abandonment deadline. + */ readonly abandonAt: number, /** The Unix timestamp when the `Session` was first created. */ readonly createdAt: number, diff --git a/packages/shared/src/types/session.ts b/packages/shared/src/types/session.ts index d37719cc20f..f65c1191a1d 100644 --- a/packages/shared/src/types/session.ts +++ b/packages/shared/src/types/session.ts @@ -221,7 +221,7 @@ export interface SessionResource extends ClerkResource { */ status: SessionStatus; /** - * The date and time when the session will expire. Unix epoch zero means no maximum lifetime. + * The date and time when the session will expire. For an [indefinite native session](https://clerk.com/docs/guides/secure/session-options#native-sessions), this represents Unix epoch zero, meaning no expiration deadline is configured. */ expireAt: Date; /** @@ -229,7 +229,7 @@ export interface SessionResource extends ClerkResource { */ readonly hasMaximumLifetime?: boolean; /** - * The abandonment deadline. Unix epoch zero means no abandonment deadline. + * The abandonment deadline. For an [indefinite native session](https://clerk.com/docs/guides/secure/session-options#native-sessions), this represents Unix epoch zero, meaning no abandonment deadline is configured. */ abandonAt: Date; /**