JavaScript
import Riza from '@riza-io/api';
const client = new Riza({
apiKey: process.env['RIZA_API_KEY'], // This is the default and can be omitted
});
const secret = await client.secrets.create({ name: 'name', value: 'value' });
console.log(secret.id);import os
from rizaio import Riza
client = Riza(
api_key=os.environ.get("RIZA_API_KEY"), # This is the default and can be omitted
)
secret = client.secrets.create(
name="name",
value="value",
)
print(secret.id)package main
import (
"context"
"fmt"
"github.com/riza-io/riza-api-go"
"github.com/riza-io/riza-api-go/option"
)
func main() {
client := riza.NewClient(
option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("RIZA_API_KEY")
)
secret, err := client.Secrets.New(context.TODO(), riza.SecretNewParams{
Name: riza.F("name"),
Value: riza.F("value"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", secret.ID)
}{
"id": "<string>",
"name": "<string>"
}{
"code": 16,
"message": "unauthenticated"
}Secrets
Create secret
Create a secret in your project.
JavaScript
import Riza from '@riza-io/api';
const client = new Riza({
apiKey: process.env['RIZA_API_KEY'], // This is the default and can be omitted
});
const secret = await client.secrets.create({ name: 'name', value: 'value' });
console.log(secret.id);import os
from rizaio import Riza
client = Riza(
api_key=os.environ.get("RIZA_API_KEY"), # This is the default and can be omitted
)
secret = client.secrets.create(
name="name",
value="value",
)
print(secret.id)package main
import (
"context"
"fmt"
"github.com/riza-io/riza-api-go"
"github.com/riza-io/riza-api-go/option"
)
func main() {
client := riza.NewClient(
option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("RIZA_API_KEY")
)
secret, err := client.Secrets.New(context.TODO(), riza.SecretNewParams{
Name: riza.F("name"),
Value: riza.F("value"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", secret.ID)
}{
"id": "<string>",
"name": "<string>"
}{
"code": 16,
"message": "unauthenticated"
}⌘I