Skip to content

Function: getScopedPath()

ts
function getScopedPath(
   ctx: Context, 
   name: string, 
   scope: "user" | "org" | "skill"): string;

Defined in: src/storage/index.ts:159

Get a scoped file path for storage based on context, name, and scope.

Parameters

ParameterTypeDescription
ctxContextCurrent execution context.
namestringName for the storage file.
scope"user" | "org" | "skill"Storage scope: 'user', 'org', or 'skill'.

Returns

string

The resolved scoped path.

Example

ts
const prefsPath = getScopedPath(ctx, 'userPreferences', 'user');
console.log(prefsPath); // /assistant/skill-storage/user-data/.../userPreferences.json

Matterway Assistant SDK Documentation