Detached Inline Scripts
Workspace Scripts
Hub Scripts
{#if tab == 'inlinescripts'} pickInlineScript(e.detail)} inlineScripts={$app.unusedInlineScripts ? $app.unusedInlineScripts.map((uis) => uis.name) : []} /> {:else if tab == 'workspacescripts'} pickScript(e.detail)} /> {:else if tab == 'hubscripts'} pickHubScript(e.detail.path)} /> {/if}
Choose a language:
{#each langs as lang} { createInlineScriptByLanguage(lang, name) }} /> {/each} { createInlineScriptByLanguage(Script.language.DENO, name, 'pgsql') }} />
Script executed in the client's browser directly: Frontend scripts are executed in the browser and can manipulate the app context directly
{ const newInlineScript = { content: `// read outputs and ctx console.log(ctx.email) // access a global state store if (!state.foo) { state.foo = 0 } state.foo += 1 // you can also navigate to another page //await goto("?foo=bar") return state.foo`, language: 'frontend', path: 'frontend script', schema: undefined } dispatch('new', newInlineScript) }} />