Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

omise-ts

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

omise-ts

A modern-day version of the [omise-node](https://github.com/omise/omise-node) package, allowing you to easily use the [Omise APIs](https://www.omise.co/docs) with Node.js.

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

omise-ts

A modern-day version of the omise-node package, allowing you to easily use the Omise APIs with Node.js.

What's wrong with the official version?

  • It's not maintained (or at least very, very rarely maintained)
  • It doesn't work with Next.js, explained in this issue

Why is this SDK better?

  • It's maintained, and it works with Next.js (see the example-app in this repo)
  • It's written in TypeScript
  • It offers more than just basic CRUD operations per resource; it also includes slightly more complex functions such as deleting all schedules for a customer

Limitations of this SDK

  • It doesn't support all Omise resources/actions, but it is very easy to add new ones
  • It relies on the types from official omise-node library

Usage

The example-app shows how to use this SDK with a Next.js application.

Install from npm

yarn add omise-ts

or

npm install omise-ts

Find your secret key on your Omise dashboard, and then you can do things like:

const Omise = new OmiseClient({
  apiSecretKey: YOUR_OMISE_SECRET_KEY,
})

// Create a charge for an existing customer
const charge = await Omise.charges.create({
  amount: 250 * 100, // 250 baht
  customer: 'cust_test_5soxme7qwp1fs0zljfx',
  currency: 'THB',
})

// Add a new card and set it as the default for a customer
const customerWithNewCard = await Omise.customers.updateDefaultCard(
  'cust_test_5soxme7qwp1fs0zljfx',
  'tokn_test_5soxo23uixfjgi0vazn'
)

// List all customers
await Omise.customers.list()

// Delete a schedule
await Omise.schedules.destroy('schd_test_5sqh1ofvhp6k9r0kxtp')

FAQs

Package last updated on 03 Mar 2023

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