bls.toml file with the right permissions before deploying.
Step 1: Add API Domains to Your bls.toml
Open your bls.toml file and, under the [deployment] section, add a permissions line listing your API domains:
- Replace
https://yourapiwebsite/with your actual API’s base URL. - Include the full domain and protocol (e.g.,
https://api.example.com/not justexample.com). - Subdomains must be separately listed. If you’re using both
https://example.com/andhttps://api.example.com/, you need both in your permissions array.
Step 2: Call APIs in Your Code
Once your API domains are set up, you can make calls usingfetch like you normally would:
Only fetch is supportednow.- The requested URL must exactly match what you set in
permissions.
Important Notes
- Permissions are locked at deploy time. You can’t update them later without redeploying.
- HTTPS only. The Shared Computer rejects non-secure HTTP API calls.
- CORS is your responsibility. Bless doesn’t modify CORS headers. Make sure the API you’re calling allows cross-origin requests.
- Security first. Only trusted, necessary APIs should be listed.