Skip to main content

Configuración

Esta guía te ayuda a configurar el SDK de Retorna para TypeScript/Node.js.

Configuración básica

import dotenv from "dotenv";
import { RetornaEnvironment, RetornaTypeScriptSDKConfigBuilder } from "retorna-typescript-sdk";

dotenv.config();

const client = new RetornaTypeScriptSDKConfigBuilder()
.environment(process.env.RETORNA_ENV as RetornaEnvironment)
.clientId(process.env.RETORNA_CLIENT_ID!)
.clientSecret(process.env.RETORNA_CLIENT_SECRET!)
.privateKey(process.env.RETORNA_PRIVATE_KEY!)
// .loggingLevel("debug")
.buildClient();

Parámetros de configuración

Environment (Requerido)

.environment("DEVELOP")    // Desarrollo/Pruebas
.environment("STAGING") // Pre-producción
.environment("PRODUCTION") // Producción

Logging (Opcional)

.loggingLevel("error") // Por defecto
.loggingLevel("warn")
.loggingLevel("info")
.loggingLevel("debug")

Credenciales (Requeridas)

.clientId("tu-client-id")
.clientSecret("tu-client-secret")
.privateKey("-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----")

Configuración con variables de entorno

Define tus variables en un archivo .env:

RETORNA_CLIENT_ID=your-client-id
RETORNA_CLIENT_SECRET=your-client-secret
RETORNA_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
RETORNA_ENV=DEVELOP
RETORNA_LOG_LEVEL=info

Siguiente Paso

Una vez configurado, revisa la Autenticación.

Resources
Blog
Find us on social networks
For complaints, please contact via email denuncias@retorna.app
We belong to the Financial Analysis Unit (UAF).
Supervised by
Registration number is C100000211.
Members of
With the support ofCon el apoyo de
Copyright © Retorna Holding Spa 2024