MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / createSearchOnlyKey

Function createSearchOnlyKey

packages/typesense/src/utils/keys.ts:82–93  ·  view source on GitHub ↗
(collectionName: string)

Source from the content-addressed store, hash-verified

80}
81
82export async function createSearchOnlyKey(collectionName: string) {
83 const key = await client.keys().create({
84 description: `Search-only`,
85 actions: ['documents:search'],
86 collections: [collectionName],
87 });
88
89 if (!key.value || !key.expires_at) {
90 throw new Error('failed to create api key');
91 }
92 return key;
93}

Callers 1

initFunction · 0.90

Calls 1

createMethod · 0.45

Tested by

no test coverage detected