eToro backend functions infrastructure for Base44, including header generation utilities
npm install base44-etoro-backend-functions-infrabash
npm install base44-etoro-backend-functions-infra
`
Usage
$3
`javascript
import { getEtoroHeaders } from 'npm:base44-etoro-backend-functions-infra';
// In your Deno.serve handler
const headers = await getEtoroHeaders(req, user);
`
$3
The function accepts an optional third parameter for configuration:
`javascript
const headers = await getEtoroHeaders(req, user, {
apiKey: 'your-api-key',
userKey: 'your-user-key'
});
`
If options are not provided, the function will attempt to read from Deno.env:
- ETORO_API_KEY
- ETORO_USER_KEY
Function Details
$3
Generates appropriate headers for eToro API requests.
Parameters:
- req (Request): The incoming request object
- user (Object): The authenticated user object with a role property
- options (Object, optional): Configuration options
- apiKey (string): eToro API key
- userKey (string): eToro user key
Returns:
- Promise