Skip to content
This repository was archived by the owner on Mar 16, 2025. It is now read-only.

Commit 9547fdf

Browse files
committed
Require API key to run the plugin
1 parent 5cdeb63 commit 9547fdf

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

.well-known/ai-plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name_for_human": "E2B code interpreter",
44
"name_for_model": "e2bcodeintepreter",
55
"description_for_human": "Sandboxed cloud environment where you can run any process, use filesystem and access the internet",
6-
"description_for_model": "Plugin for writting and reading files and running processes in a cloud environment.",
6+
"description_for_model": "Plugin for writing and reading files and running processes with access to the internet in a cloud environment.",
77
"auth": {
88
"type": "none"
99
},

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,12 @@ To install the required packages for this plugin, run the following command:
7777
npm install
7878
```
7979

80-
To run the plugin, enter the following command:
80+
To run the plugin, you will need **API Key**. Click [here](https://e2b.dev/docs?reason=sdk-missing-api-key) to get your API key.
81+
82+
Then enter the following command:
8183

8284
```bash
83-
npm run dev
85+
E2B_API_KEY=*** npm run dev
8486
```
8587

8688
Once the local server is running:

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ import { readFileSync } from 'fs'
1515
import { RegisterRoutes } from './generated/routes'
1616
import { defaultPort } from './constants'
1717

18+
const apiKey = process.env.E2B_API_KEY
19+
if (!apiKey) throw new Error('E2B_API_KEY is not set. Please visit https://e2b.dev/docs?reason=sdk-missing-api-key to get your API key.')
20+
1821
export const app = express()
1922

2023
app.use(

src/sessions/session.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export class CachedSession {
3838
constructor(envID: string) {
3939
this.session = new Session({
4040
id: envID,
41+
apiKey: process.env.E2B_API_KEY,
4142
onClose: () => {
4243
this.delete()
4344
},

0 commit comments

Comments
 (0)