Storage Comparison

Here’s a visual comparison table of the three server-side storage methods available in JENTIS: userStorage, global userStorage, and toolInstanceStorage. This table will help you choose the right storage type for your specific use case:


Storage Scope Comparison

Feature / Property

userStorage (Per Tool)

userStorage (Global)

toolInstanceStorage

Scope

Per user, per tool instance

Per user, shared across all tools

Shared across all users, per tool instance

Shared Across Tools

No

Yes

No

Shared Across Users

No

No

Yes

Primary Use Case

Store user-specific data like client_id, gclid for a specific tool

Store unified identifiers like client_id across multiple tools

Store shared secrets or tokens like auth_token for a tool

Read/Write Interface

this.userStorage.read("key") / write(...)

this.userStorage.read("key", true) / write(..., true)

this.toolInstanceStorage.read("key") / write(...)

Delete Interface

this.userStorage.delete("key")

this.userStorage.delete("key", true)

this.toolInstanceStorage.delete("key")

Data Lifespan

Controlled via expiration timestamp

Controlled via expiration timestamp

Controlled via expiration timestamp

Supported in Server-Side Variables

Yes

Yes

Yes

Global Flag Required

No

Yes (pass true as last parameter)

No

Example Use

Store fbclid for Tool A only

Store client_id globally for all tools

Store access_token for an API integration


Recommendations

Goal
Recommended Storage

Store user-specific values for a single tool

userStorage (per tool)

Store user-specific values shared across tools

userStorage (global)

Store tool-specific data shared across users

toolInstanceStorage


This comparison ensures that you select the correct storage mechanism depending on who the data belongs to (user vs. tool) and how widely it needs to be shared (tool-only, global, or cross-user).

Last updated

Was this helpful?