New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@zenova-corp/key

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zenova-corp/key

A secure API key authentication module

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by50%
Maintainers
0
Weekly downloads
 
Created
Source

@zenova-corp/key

Welcome to @zenova-corp/key! 🎉 A super handy package for managing your API keys with CockroachDB integration. Whether you want to add, update, or delete API keys, this package will make it a breeze! It even handles missing data gracefully with default values and makes sure your keys are stored securely.

🚀 Features

  • Effortlessly add, update, and delete API keys.
  • Default values for missing fields (0, false, etc.).
  • Smooth integration with CockroachDB for storing your API keys.
  • Works out of the box with .env configuration.
  • Code structure designed with security in mind to keep things safe and sound!

💡 Installation

Ready to get started? Here’s how to install the package in your Node.js project:

  1. Open your terminal and run:

    npm install @zenova-corp/key
    

    🚀 Boom! You’re all set to use it.

🛠️ Usage

Let’s jump straight into it! Below are some examples to get you going quickly. With @zenova-corp/key, you can easily manage your API keys. Whether it’s adding a new key, updating an existing one, or cleaning up old ones, it’s all at your fingertips.

Add a New API Key

const apiKeyManager = require('@zenova-corp/key');

// Add a brand new API key with all details
apiKeyManager.addApiKey('new-api-key', {
  expiryDate: 'unli',
  remainingRequests: 1000,
  maxRequests: 1000,
  lastAccessDate: '2024-11-20',
});

Update an Existing API Key

// Update an existing API key with new information
apiKeyManager.updateApiKey('existing-api-key', {
  remainingRequests: 500,  // Updated remaining requests
  maxRequests: 500,        // Updated max requests
});

Delete an API Key

// Delete an API key that’s no longer needed
apiKeyManager.deleteApiKey('existing-api-key');

🔑 Methods

Here’s a breakdown of the methods available in the package:

  • addApiKey(apiKey, data): 🌟 Adds a new API key with the provided data. Pass in as much or as little as you like!
  • updateApiKey(apiKey, data): 🔄 Updates an existing API key with the new details. Perfect for when you need to tweak the limits or expiration date.
  • deleteApiKey(apiKey): ❌ Removes an API key from your database.

📝 Configuration

To get your package up and running, you’ll need to set up your CockroachDB configuration in a .env file. Don’t worry, it’s quick and easy!

  1. Create a .env file in the root of your project.
  2. Add the following values for your CockroachDB connection:
COCKROACH_DB_HOST=your-cockroachdb-host
COCKROACH_DB_PORT=26257
COCKROACH_DB_USER=your-db-user
COCKROACH_DB_PASSWORD=your-db-password
COCKROACH_DB_NAME=your-db-name

Once you’ve done that, your API key management is ready to go! 🎉

🎉 License

This package is licensed under the MIT License. Check out the full details in the LICENSE file.

🤝 Contributing

Got an idea or want to improve things? Pull requests and issues are always welcome! 😄 If you want to contribute, just fork this repo, make your changes, and submit a pull request. Let’s make this package even better together! 🎨


✨ Enjoy using @zenova-corp/key to manage your API keys easily and securely! 🚀

Keywords

FAQs

Package last updated on 14 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc