arcjet / arcjet-js

Arcjet JS SDKs. Rate limiting, bot protection, email verification & attack defense for Node.js, Next.js, Bun & SvelteKit.
https://arcjet.com
Apache License 2.0
174 stars 3 forks source link

Investigate SvelteKit deployment adapters #886

Open blaine-arcjet opened 1 month ago

blaine-arcjet commented 1 month ago

We should try out various SvelteKit deployment adapters to make sure the integration works across them.

maietta commented 3 weeks ago

I'm running into this:

Cannot find package '$env' imported from /path/to/node_modules/@arcjet/sveltekit/index.js

I don't know if I should open a new issue for this or not since you mentioned the need to investigate SvelteKit deployments.

For the record, I am deploying using svelte-adapter-bun and the Bun runtime on the server side. Specifically, version 1.1.13 at the time of this writing.

davidmytton commented 3 weeks ago

Thanks for the report @maietta. I've been able to reproduce this with both Bun and Node, so it looks like a broader issue. I've logged https://github.com/arcjet/arcjet-js/issues/982 and we'll look into it on Monday.

blaine-arcjet commented 3 weeks ago

@maietta Please try out 1.0.0-alpha.17 which switched from importing the $env/dynamic/private module to using process.env. I hope it works because I couldn't actually find the SvelteKit code that disallowed $env/dynamic/private 🙈

maietta commented 3 weeks ago

Thank you, @blaine-arcjet . I will do that now and report back.

Update:

Using the API endpoint example for SvleteKit found here:

https://docs.arcjet.com/get-started/sveltekit

It's working perfectly with 1.0.0-alpha.17.

Thank you very, very much. I'm working to launch my website this week, so the timing is great!