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#
- Redenv CLI installed (Installation Guide)
- An Upstash Redis database (free tier available at upstash.com)
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.
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>;
}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-appYou'll be prompted to:
- Enter a master password - this encrypts your project's secrets
- 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 productionStep 4: List Secrets#
View your secrets:
redenv listOutput:
┌─────────────────┬────────────────────────────────────────────┐
│ 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.jsUsing the SDK#
Install the JavaScript SDK:
npm install @redenv/clientimport { Secrets } from "@redenv/client";
const secrets = new Secrets({
token: process.env.REDENV_TOKEN, // Service token
});
const dbUrl = await secrets.get("DATABASE_URL");Next Steps#
- Learn about Encryption to understand how your secrets are protected
- Explore CLI Commands for all available operations
- Set up the JavaScript SDK or Python SDK