Import code using $lib/ (SvelteKit) #1247
cellulosa
started this conversation in
Show and tell
Replies: 1 comment 2 replies
-
Hello @cellulosa, Nice tip! I do have a question regarding the $env in SvelteKit, have you managed to get this to work? import { env } from '$env/dynamic/private';
import { createClient } from '@supabase/supabase-js';
export const supabase = createClient(env.SUPABASE_URL, env.SUPABASE_SERVICE_ROLE_KEY); Thankful for any tips regarding this 🙇♂️ |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In case it could be useful to others, here's how I managed to make trigger.dev to use SvelteKit's $lib definition
that's it, now on your triggers you can import other files as usual e.g.
Perhaps someone will come up with a better approach, as currently one has to define $lib (or any other) manually...
Beta Was this translation helpful? Give feedback.
All reactions