Tooling
Module SDK
Modules
Policies
getTimeFramePolicy

⚠️ Deprecation Notice

ModuleSDK was developed by Rhinestone and is no longer actively supported. For new projects, we recommend using the Rhinestone SDK instead.

Rhinestone SDK Documentation (opens in a new tab)

getTimeFramePolicy

Get the timeframe policy to use when creating a new session. The timeframe policy can be used to restrict a session to only be able to be used within a certain timeframe.

Usage

const timeFramePolicy = getTimeFramePolicy({
  validAfter: 0, // always valid start
  validUntil: Date.now() + 60 * 60 * 24, // valid for 24 hours
})

Parameters

validAfter

  • Type: number

The timestamp after which the session is valid in seconds.

validUntil

  • Type: number

The timestamp until which the session is valid in seconds.

Returns

policy

The timeframe policy.