mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 19:28:09 +00:00
Point getting started SDK to SDK repos to avoid docs sprawl
This commit is contained in:
@@ -62,7 +62,7 @@ class EELicenseService {
|
|||||||
environmentLimit: null,
|
environmentLimit: null,
|
||||||
environmentsUsed: 0,
|
environmentsUsed: 0,
|
||||||
secretVersioning: true,
|
secretVersioning: true,
|
||||||
pitRecovery: true,
|
pitRecovery: false,
|
||||||
ipAllowlisting: false,
|
ipAllowlisting: false,
|
||||||
rbac: false,
|
rbac: false,
|
||||||
customRateLimits: false,
|
customRateLimits: false,
|
||||||
|
|||||||
@@ -9,137 +9,11 @@ Prerequisites:
|
|||||||
- Have a project with secrets ready in [Infisical Cloud](https://app.infisical.com).
|
- Have a project with secrets ready in [Infisical Cloud](https://app.infisical.com).
|
||||||
- Create an [Infisical Token](/documentation/platform/token) scoped to an environment in your project in Infisical.
|
- Create an [Infisical Token](/documentation/platform/token) scoped to an environment in your project in Infisical.
|
||||||
|
|
||||||
## Installation
|
## Usage
|
||||||
|
|
||||||
Follow the instructions for your language to install the SDK for it.
|
Follow the instructions for your language use the SDK for it:
|
||||||
|
|
||||||
<Tabs>
|
- [Node SDK](https://github.com/Infisical/infisical-node)
|
||||||
<Tab title="Node">
|
- [Python SDK](https://github.com/Infisical/infisical-python)
|
||||||
|
|
||||||
Run `npm` to add [infisical-node](https://github.com/Infisical/infisical-node) to your project.
|
Missing a language? [Throw in a request](https://github.com/Infisical/infisical/issues).
|
||||||
|
|
||||||
```console
|
|
||||||
$ npm install infisical-node --save
|
|
||||||
```
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
Import the SDK and create a client instance with your [Infisical Token](/documentation/platform/token).
|
|
||||||
|
|
||||||
<Tabs>
|
|
||||||
<Tab title="ES6">
|
|
||||||
```js
|
|
||||||
import InfisicalClient from "infisical-node";
|
|
||||||
|
|
||||||
const client = new InfisicalClient({
|
|
||||||
token: "your_infisical_token"
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
</Tab>
|
|
||||||
<Tab title="ES5">
|
|
||||||
```js
|
|
||||||
const InfisicalClient = require("infisical-node");
|
|
||||||
|
|
||||||
const client = new InfisicalClient({
|
|
||||||
token: "your_infisical_token"
|
|
||||||
});
|
|
||||||
````
|
|
||||||
</Tab>
|
|
||||||
</Tabs>
|
|
||||||
## Get a Secret
|
|
||||||
|
|
||||||
```js
|
|
||||||
const secret = await client.getSecret("API_KEY");
|
|
||||||
const value = secret.secretValue; // get its value
|
|
||||||
```
|
|
||||||
|
|
||||||
## Basic Usage
|
|
||||||
|
|
||||||
```js
|
|
||||||
import express from "express";
|
|
||||||
import InfisicalClient from "infisical-node";
|
|
||||||
const app = express();
|
|
||||||
const PORT = 3000;
|
|
||||||
|
|
||||||
const client = new InfisicalClient({
|
|
||||||
token: "YOUR_INFISICAL_TOKEN"
|
|
||||||
});
|
|
||||||
|
|
||||||
app.get("/", async (req, res) => {
|
|
||||||
// access value
|
|
||||||
const name = await client.getSecret("NAME");
|
|
||||||
res.send(`Hello! My name is: ${name.secretValue}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
app.listen(PORT, async () => {
|
|
||||||
console.log(`App listening on port ${port}`);
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
This example demonstrates how to use the Infisical Node SDK with an Express application. The application retrieves a secret named "NAME" and responds to requests with a greeting that includes the secret value.
|
|
||||||
</Tab>
|
|
||||||
<Tab title="Python">
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
Run `pip` to add [infisical-python](https://github.com/Astropilot/infisical-python) to your project
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ pip install infisical
|
|
||||||
```
|
|
||||||
|
|
||||||
Note: You need Python 3.7+.
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
Import the SDK and create a client instance with your [Infisical Token](/documentation/platform/token).
|
|
||||||
|
|
||||||
```py
|
|
||||||
from infisical import InfisicalClient
|
|
||||||
|
|
||||||
client = InfisicalClient(token="your_infisical_token")
|
|
||||||
```
|
|
||||||
|
|
||||||
## Get a Secret
|
|
||||||
|
|
||||||
```py
|
|
||||||
secret = client.get_secret("API_KEY")
|
|
||||||
value = secret.secret_value # get its value
|
|
||||||
```
|
|
||||||
|
|
||||||
## Basic Usage
|
|
||||||
|
|
||||||
```py
|
|
||||||
from flask import Flask
|
|
||||||
from infisical import InfisicalClient
|
|
||||||
|
|
||||||
app = Flask(__name__)
|
|
||||||
|
|
||||||
client = InfisicalClient(token="your_infisical_token")
|
|
||||||
|
|
||||||
@app.route("/")
|
|
||||||
def hello_world():
|
|
||||||
# access value
|
|
||||||
name = client.get_secret("NAME")
|
|
||||||
return f"Hello! My name is: {name.secret_value}"
|
|
||||||
```
|
|
||||||
|
|
||||||
This example demonstrates how to use the Infisical Python SDK with a Flask application. The application retrieves a secret named "NAME" and responds to requests with a greeting that includes the secret value.
|
|
||||||
</Tab>
|
|
||||||
<Tab title="Other">
|
|
||||||
We're currently working on SDKs for other languages. Follow the GitHub issue for your needed language below:
|
|
||||||
- [Java](https://github.com/Infisical/infisical/issues/434)
|
|
||||||
- [Ruby](https://github.com/Infisical/infisical/issues/435)
|
|
||||||
- [Go](https://github.com/Infisical/infisical/issues/436)
|
|
||||||
- [Rust](https://github.com/Infisical/infisical/issues/437)
|
|
||||||
- [PHP](https://github.com/Infisical/infisical/issues/531)
|
|
||||||
|
|
||||||
Missing a language? [Throw in a request](https://github.com/Infisical/infisical/issues).
|
|
||||||
</Tab>
|
|
||||||
</Tabs>
|
|
||||||
|
|
||||||
See also:
|
|
||||||
|
|
||||||
- Explore the [Node SDK](https://github.com/Infisical/infisical-node)
|
|
||||||
- Explore the [Python SDK](https://github.com/Infisical/infisical-python)
|
|
||||||
Reference in New Issue
Block a user