https://github.com/nitrictech/node-sdk
Node SDK for Nitric
https://github.com/nitrictech/node-sdk
backend cloud javascript js nitric node node-js serverless ts typescript
Last synced: 21 days ago
JSON representation
Node SDK for Nitric
- Host: GitHub
- URL: https://github.com/nitrictech/node-sdk
- Owner: nitrictech
- License: apache-2.0
- Created: 2020-11-02T06:20:15.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-06T00:59:48.000Z (about 2 months ago)
- Last Synced: 2025-03-28T16:21:27.570Z (29 days ago)
- Topics: backend, cloud, javascript, js, nitric, node, node-js, serverless, ts, typescript
- Language: JavaScript
- Homepage: https://nitric.io
- Size: 2.06 MB
- Stars: 69
- Watchers: 5
- Forks: 5
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Build Nitric applications with Node.jsThe NodeJS SDK supports the use of the Nitric framework with NodeJS 12+. For more information, check out the main [Nitric repo](https://github.com/nitrictech/nitric).
Nitric SDKs provide an infrastructure-as-code style that lets you define resources in code. You can also write the functions that support the logic behind APIs, subscribers and schedules.
You can request the type of access you need to resources such as publishing for topics, without dealing directly with IAM or policy documents.
- Reference Documentation: https://nitric.io/docs/reference/nodejs
- Guides: https://nitric.io/docs/guides/nodejs## Usage
### Starting a new project
Install the [Nitric CLI](https://nitric.io/docs/getting-started/installation), then generate your project:
TypeScript:
```bash
nitric new hello-world ts-starter
```JavaScript:
```bash
nitric new hello-world js-starter
```### Add to an existing project
First of all, you need to install the library:
```bash
npm install @nitric/sdk
```Then you're able to import the library and create cloud resources:
```typescript
import { api, bucket } from '@nitric/sdk';const publicApi = api('public');
const uploads = bucket('uploads').allow('write');publicApi.get('/upload', async (ctx) => {
const photo = uploads.file('images/photo.png');const url = await photo.getUploadUrl({
expiry: 300,
});return ctx.res.json({ url });
});
```## Learn more
Learn more by checking out the [Nitric documentation](https://nitric.io/docs).
## Get in touch:
- Join us on [Discord](https://nitric.io/chat)
- Ask questions in [GitHub discussions](https://github.com/nitrictech/nitric/discussions)
- Find us on [Twitter](https://twitter.com/nitric_io)
- Send us an [email](mailto:[email protected])