mirror of
https://github.com/Infisical/infisical.git
synced 2025-04-17 19:37:38 +00:00
Update quickstart example
This commit is contained in:
@ -64,9 +64,9 @@ These examples demonstrate how to store and fetch environment variables from [In
|
||||
### Initialize the Infisical client
|
||||
|
||||
```js
|
||||
import infisical from "infisical-node";
|
||||
import InfisicalClient from "infisical-node";
|
||||
|
||||
infisical.connect({
|
||||
const client = new InfisicalClient({
|
||||
token: "your_infisical_token",
|
||||
});
|
||||
```
|
||||
@ -74,25 +74,25 @@ These examples demonstrate how to store and fetch environment variables from [In
|
||||
### Get a value
|
||||
|
||||
```js
|
||||
const value = await infisical.getSecret("SOME_KEY");
|
||||
const value = await client.getSecret("SOME_KEY");
|
||||
```
|
||||
|
||||
### Example with Express
|
||||
|
||||
```js
|
||||
import infisical from "infisical-node";
|
||||
import InfisicalClient from "infisical-node";
|
||||
import express from "express";
|
||||
const app = express();
|
||||
const PORT = 3000;
|
||||
|
||||
await infisical.connect({
|
||||
const client = InfisicalClient({
|
||||
token: "st.xxx.xxx",
|
||||
});
|
||||
|
||||
// your application logic
|
||||
|
||||
app.get("/", async (req, res) => {
|
||||
const name = await infisical.getSecret("NAME");
|
||||
const name = await client.getSecret("NAME");
|
||||
res.send(`Hello! My name is: ${name.secretValue}`);
|
||||
});
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
title: "Node"
|
||||
---
|
||||
|
||||
If you're working with Node.js, the official [infisical-node](https://github.com/Infisical/infisical-node) package is the easiest way to fetch and work with ecrets for your application.
|
||||
If you're working with Node.js, the official [infisical-node](https://github.com/Infisical/infisical-node) package is the easiest way to fetch and work with secrets for your application.
|
||||
|
||||
## Installation
|
||||
|
||||
|
Reference in New Issue
Block a user