This feature isnβt available on every plan.
Refer to your pricing plan to see if itβs included.
Create a code transformation
- Go to the Algolia dashboard and select your Algolia application.
- On the left sidebar, select Data sources.
- Open the Connectors page.
- Select a connector and click Connect to start creating your task.
- Create a new source or select an existing one.
- To create a transformation function, click Create transformation.
Retrieve and store secrets
To call an external API, you typically need an API key or other credential type (such as basic access authentication or OAuth 2.0). You can store these credentials as a secret and reference them in your transformation code.
- Retrieve the secret from the third-party API.
- In your code transformation, click Secret.
- Paste in the third-party API key, give it name, then click Add.
JavaScript
How to use fetch helper functions
- Click Helper Functions.
- Select Fetch / API
- Select a helper and click Add.
Third-party APIs
Helper | Description |
---|---|
OpenAI - Text Generation | Generate text based on a prompt. You need an OpenAI API key to use this function. For more information, see the OpenAI text generation documentation. |
OpenAI - Vision | Generate a description or tags for an image. You need an OpenAI API key to use this function. For more information, see the OpenAI vision documentation. |
Convert currency | Convert a currency to another. You need a CurrencyAPI API key to use this function. For more information, see the CurrencyAPI documentation . |
Translate text | Translate text from one language to another. You need a DeepL API key to use this function. For more information, see the DeepL documentation. |
Generic function
This function lets you connect to any service with an API.Helper type | Description |
---|---|
Fetch with API key (in header) | Connect to any service with an API key in the header. |
Fetch with API key (in URL) | Connect to any service with an API key in the query. |
Fetch with Basic Auth | Connect to any service with basic access authentication. |
Thereβs a timeout and response size limit on all transformations that include Fetch requests.