Best practice for calling 3P APIs with private credentials from SvelteKit SPA on Appwrite Sites
- 0
- Web
- Sites
- Cloud
- Functions
- REST API
Hey everyone! Looking for guidance on the recommended approach for securely calling third-party APIs from my Appwrite-hosted application.
Current Setup:
- SvelteKit application running as a SPA (client-side only)
- Deployed on Appwrite Sites
- Using Appwrite for auth and database
What I need to do: I need to make API calls to external services (e.g., payment processors, data providers) that require private API keys/credentials. Obviously, I can't expose these credentials in my client-side code.
What I'm considering:
- Using Appwrite Functions as a proxy/backend to store credentials and make the API calls
- Converting my SvelteKit app to SSR (a much larger overhaul of the codebase including auth migration which I'd like to avoid if possible)
- Some other Appwrite-native solution I'm not aware of?
Questions:
- What's the recommended pattern within the Appwrite ecosystem for this use case?
- If Appwrite Functions is the way to go, are there any examples or best practices for using them as an API proxy?
- Are there any performance or rate limit considerations I should be aware of?
- Should I be looking at a different Appwrite deployment option altogether?
Would appreciate any insights from those who've solved similar problems. Thanks!
Recommended threads
- is `account.get()` safe to be used in th...
I want to user's `id` for authentication. However, a while ago I was told in this server not to use `account.get()` and instead add user preferences for that us...
- Appwrite console is too heavy
The Appwrite console is too heavy And all of my services broken Any support , please
- router_deployment_not_found
I updated my function a few times and now i am getting the error: router_deployment_not_found I even reverted back to my original code but i am still getting th...