Quickstart

Create your first Redenv project in under 5 minutes.

This guide will walk you through creating your first Redenv project, adding secrets, and using them in your application.

Prerequisites#

Step 1: Configure Upstash#

First, set up your Upstash credentials:

Tip

It can be used without Fumadocs UI, in other words, it's headless.

For beginners and normal usages, use Fumadocs UI.

Add Markdown/meta files for different languages by attending .{locale} to your file name, like:

For the default locale, the locale code is optional.

config.rs
import type { ReactNode } from 'react';
import { NextProvider } from 'fumadocs-core/framework/next';

export function RootLayout({ children }: { children: ReactNode }) {
  // or if you're using Fumadocs UI, use `<RootProvider />`
  return <NextProvider>{children}</NextProvider>;
}

All content files are grouped by language folders:

import type { ReactNode } from "react";
import { NextProvider } from "fumadocs-core/framework/next";

export function RootLayout({ children }: { children: ReactNode }) {
  // or if you're using Fumadocs UI, use `<RootProvider />`
  return <NextProvider>{children}</NextProvider>;
}
import type { ReactNode } from "react";
import { ReactRouterProvider } from "fumadocs-core/framework/react-router";

export function Root({ children }: { children: ReactNode }) {
  return <ReactRouterProvider>{children}</ReactRouterProvider>;
}
import type { ReactNode } from "react";
import { TanstackProvider } from "fumadocs-core/framework/tanstack";

export function Root({ children }: { children: ReactNode }) {
  return <TanstackProvider>{children}</TanstackProvider>;
}
import type { ReactNode } from "react";
import { WakuProvider } from "fumadocs-core/framework/waku";

export function Root({ children }: { children: ReactNode }) {
  return <WakuProvider>{children}</WakuProvider>;
}
config.js
import createMDX from "fumadocs-mdx/config";

const withMDX = createMDX();

/** @type {import('next').NextConfig} */
const config = {
  reactStrictMode: true, 
}; 

export default withMDX(config);

You can find these values in your Upstash Console under the Redis database details.

Step 2: Initialize a Project#

Create a new Redenv project:

redenv init my-app

You'll be prompted to:

  1. Enter a master password - this encrypts your project's secrets
  2. Confirm the password

Important: Store your master password securely. Without it, you cannot access your secrets.

Step 3: Add Your First Secret#

Add a secret to your project:

redenv set DATABASE_URL "postgres://user:pass@host:5432/db"

By default, secrets are added to the development environment. Use --env for other environments:

redenv set DATABASE_URL "postgres://prod@host:5432/db" --env production

Step 4: List Secrets#

View your secrets:

redenv list

Output:

┌─────────────────┬────────────────────────────────────────────┐
│ Key             │ Value                                      │
├─────────────────┼────────────────────────────────────────────┤
│ DATABASE_URL    │ postgres://user:pass@host:5432/db          │
└─────────────────┴────────────────────────────────────────────┘

Step 5: Use in Your Application#

Using the CLI (Run Command)#

Run your application with secrets injected as environment variables:

redenv run -- node app.js

Using the SDK#

Install the JavaScript SDK:

npm install @redenv/client
import { Secrets } from "@redenv/client";

const secrets = new Secrets({
  token: process.env.REDENV_TOKEN, // Service token
});

const dbUrl = await secrets.get("DATABASE_URL");

Next Steps#