MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / loadToken

Function loadToken

templates/bun-ts/src/main.ts:155–166  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

153const TOKEN_FILE = '.spacetimedb-token';
154
155async function loadToken(): Promise<string | undefined> {
156 try {
157 const file = Bun.file(TOKEN_FILE);
158 if (await file.exists()) {
159 const text = await file.text();
160 return text.trim() || undefined;
161 }
162 } catch (err) {
163 console.warn('Could not load token:', err);
164 }
165 return undefined;
166}
167
168async function saveToken(token: string): Promise<void> {
169 try {

Callers 1

mainFunction · 0.70

Calls 2

warnMethod · 0.80
textMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…