npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

iyzipay-node-ts

v0.2.0

Published

Modern, Type-Safe and Edge-Compatible Iyzipay Client for Node.js & Next.js

Downloads

174

Readme

🚀 iyzipay-node-ts

NPM Version License Downloads TypeScript

The Modern, Type-Safe, and Edge-Ready Iyzico Client. Designed for Next.js, Cloudflare Workers, Bun, and modern Node.js backends.

⚠️ Unofficial Client: This package is not affiliated with Iyzico. It is an open-source initiative to provide a better Developer Experience (DX).


✨ Why this package?

The official Iyzico library relies on legacy modules (request, fs), has no proper TypeScript support, and is bloated. iyzipay-node-ts changes the game:

  • 🛡️ Full Type Safety: Inputs & Outputs are fully typed with Zod schemas.
  • Edge Ready: Zero dependencies. Uses native fetch. Runs on Vercel Edge, Cloudflare, etc.
  • 🛠️ DX First: Includes Builders, Test Card Presets, and Validators.
  • 🇹🇷 Local Helpers: Built-in TCKN (Turkish ID) and Luhn (Credit Card) validators.
  • 🔐 Secure: Automatic Webhook signature verification & Browser-Usage Guard.

📦 Installation

pnpm add iyzipay-node-ts
# or
npm install iyzipay-node-ts
# or
bun add iyzipay-node-ts

⚡ Quick Start

1. Initialize Client

Use the modern factory function createClient or iyzipay:

import { createClient } from 'iyzipay-node-ts';

const client = createClient({
  apiKey: process.env.IYZICO_API_KEY!,
  secretKey: process.env.IYZICO_SECRET_KEY!,
  baseUrl: process.env.IYZICO_BASE_URL || '[https://sandbox-api.iyzipay.com](https://sandbox-api.iyzipay.com)',
});

2. Create Payment (The Modern Way)

Forget writing 50 lines of boilerplate JSON. Use Inputs Builder and Test Presets:

import { Inputs, TestCards, Currency, PaymentGroup } from 'iyzipay-node-ts';

const { data, error } = await client.payment.create({
  price: '100.00',
  currency: Currency.TRY,
  paymentGroup: PaymentGroup.PRODUCT,
  
  // ⚡ Use a Preset Card (No need to search PDFs for test numbers)
  paymentCard: TestCards.Success.GarantiDebit, 
  
  // 🛠️ Use Builder to auto-fill bureaucratic fields (IP, City, etc.)
  buyer: Inputs.buyer({
    id: 'USER-123',
    name: 'John',
    surname: 'Doe',
    email: '[email protected]',
    identityNumber: '11111111111'
  }),
  shippingAddress: Inputs.address('Nidakule Göztepe', 'John Doe'),
  billingAddress: Inputs.address('Nidakule Göztepe', 'John Doe'),
  basketItems: [
    Inputs.basketItem('Nike Air Jordan', '100.00', 'Shoes')
  ]
});

if (error) {
  console.error('Payment Failed:', error.errorMessage);
} else {
  console.log('Success! Payment ID:', data.paymentId);
}

🧰 Superpowers (Utilities)

🇹🇷 Validators (TCKN & Credit Card)

Don't install extra packages. We built them in with Zod.

import { IyzipayValidators } from 'iyzipay-node-ts';
import { z } from 'zod';

const CheckoutForm = z.object({
  fullName: z.string(),
  // Validates Turkish ID Number algorithm (Mod 10)
  identityNumber: IyzipayValidators.tcKimlikNo, 
  // Validates Credit Card Checksum (Luhn Algorithm)
  cardNumber: IyzipayValidators.creditCard,     
});

// Example Usage
CheckoutForm.parse({ identityNumber: "11111111110" }); // Throws ZodError if invalid

🧪 Test Card Presets

IntelliSense will show you all available test cards.

import { TestCards } from 'iyzipay-node-ts';

// Success Scenarios
TestCards.Success.AkbankCredit
TestCards.Success.GarantiAmex

// Error Scenarios (Test your error handling)
TestCards.Errors.InsufficientFunds  // Returns Error 10051
TestCards.Errors.StolenCard         // Returns Error 10043

🪝 Webhook Verification

Secure your endpoints easily.

import { verifyWebhookSignature } from 'iyzipay-node-ts';

// In your API Route / Controller
const isValid = await verifyWebhookSignature({
  secretKey: process.env.IYZICO_SECRET_KEY!,
  body: JSON.stringify(req.body), // Raw body string
  signature: req.headers['x-iyz-signature']
});

if (!isValid) throw new Error('Invalid Webhook Signature');

🗺️ Roadmap & Vision

We aim to build a complete ecosystem around Iyzico for Node.js developers. Check out our ROADMAP.md for upcoming features like CLI and Documentation App.

🤝 Contributing

Contributions are welcome! Please read our contributing guidelines.

📄 License

MIT © Mehmet Yiğit Yalım