¿Qué son los runtime tokens?
Los runtime tokens (prefijo jfn_rt_) son credenciales que autentican las peticiones a tus funciones en producción. Cada función tiene al menos un token activo.
Generación automática
El primer deploy de una función genera un token automáticamente:
jelou deploy
# ✓ Deployed
# ▸ URL: https://mi-funcion.fn.jelou.ai
# ⚠ A default runtime token was created for this function.
# Save it now — it will not be shown again.
# ▸ Token jfn_rt_abc123...
El token se muestra una sola vez. Los deploys subsiguientes no lo muestran. Si lo pierdes, crea uno nuevo con jelou tokens create.
Cómo usarlos
Envía el token en el header X-Jelou-Token:
curl -X POST https://mi-funcion.fn.jelou.ai \
-H "Content-Type: application/json" \
-H "X-Jelou-Token: jfn_rt_abc123..." \
-d '{"telefono": "593987654321"}'
const res = await fetch("https://mi-funcion.fn.jelou.ai", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Jelou-Token": process.env.JELOU_FUNCTION_TOKEN,
},
body: JSON.stringify({ telefono: "593987654321" }),
});
import requests, os
res = requests.post(
"https://mi-funcion.fn.jelou.ai",
headers={
"Content-Type": "application/json",
"X-Jelou-Token": os.environ["JELOU_FUNCTION_TOKEN"],
},
json={"telefono": "593987654321"},
)
| Regla | Detalle |
|---|
| Header | X-Jelou-Token (no Authorization: Bearer) |
| Formato | No query param, no body — solo header |
| Tamaño máximo | 4 KB |
| Sin token | 401 { "error": "Unauthorized" } |
Gestión con CLI
Listar tokens
jelou tokens list mi-funcion
# ▸ Name Prefix Last Used Created
# ▸ default jfn_rt_abc1.. 4/7/2026, 10:30:00 AM 4/1/2026, 2:00:00 PM
# ▸ ci-deploy jfn_rt_def4.. never 4/5/2026, 9:00:00 AM
Crear token adicional
jelou tokens create mi-funcion --name ci-deploy
# ✓ Created token "ci-deploy"
# ▸ Token jfn_rt_def456...
# ⚠ Save this token now — it will not be shown again.
Revocar token
jelou tokens revoke mi-funcion <token-id>
# ? Revoke token jfn_rt_def4... for mi-funcion? (y/N) y
# ✓ Token revoked
Múltiples tokens
Puedes tener varios tokens activos por función — uno por entorno, servicio o equipo:
default — generado en el primer deploy
ci-staging — para el pipeline de staging
brain-studio — para Brain Studio
partner-api — para un integrador externo
Revocar uno no afecta a los demás.
¿Perdiste el token?
- Crea uno nuevo:
jelou tokens create mi-funcion --name nuevo
- El token anterior sigue activo (no se revoca automáticamente)
- Si el token fue comprometido, revócalo:
jelou tokens revoke mi-funcion <id>
CI/CD
Crear tokens desde pipelines:
# Crear token y extraer el valor con jq
TOKEN=$(jelou tokens create mi-funcion --name ci-staging --json | jq -r '.data.token')
echo "::add-mask::$TOKEN"
Brain Studio
Configura tu función como servidor MCP externo:
| Campo | Valor |
|---|
| URL | https://mi-funcion.fn.jelou.ai/mcp |
| Header name | X-Jelou-Token |
| Header value | jfn_rt_abc123... |
Pasar token a otra función
Guarda el token de la función destino como secret:
jelou secrets set mi-funcion OTRA_FUNCION_TOKEN=jfn_rt_xyz789...
handler: async (input, ctx) => {
const res = await fetch("https://otra-funcion.fn.jelou.ai", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Jelou-Token": ctx.env.get("OTRA_FUNCION_TOKEN")!,
},
body: JSON.stringify({ dato: input.valor }),
});
return await res.json();
}