I’m happy to announce we've just released a new feature called Secrets Manager.
The Secrets Manager was created to help you have even better security for your site.
It allows you to safely work with secrets (such as API keys), by storing their values in a secure repository, rather than hardcoded strings in your code.
The value of each secret is safely stored and encrypted, and can be fetched through the Secrets API.
To use this feature, go to the Business Manager → Settings → Secrets Manager (under Production Tools)
Learn more about the Secrets Manager
Try it out and let us know what you think!
Hey @Aviv Fattal
I have a feature request. Will it possible to store api keys from the site page? This will be useful for online marketplaces where we ask sellers to create a profile in order to list products and sell it on the marketplace.
Sellers can enter their API key for the payment platform which gets saved into the Secrets Manager and their API key can be identified via their email or User ID.
Is something like this possible in the future? Would allow us to take on more custom Marketplace projects.
This is fantastic @Aviv !! Not even something I would have thought I needed until now. So instead of storing our API keys in backend .js files and exporting them as objects, we can skip making an entire file.
This really is good news.
Original post
Here's how I'm using it and it is returning empty
import {getSecret} from 'wix-secrets-backend'; export async function send (data) { const APIkey = getSecret('myAPI') console.log(APIkey) // => {} empty }