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

@technitsolutions/capacitor-conekta-tokenizer

v1.2.1

Published

Capacitor 8 plugin for Conekta card tokenization - create payment tokens from card details via direct API calls

Downloads

383

Readme

@technitsolutions/capacitor-conekta-tokenizer

Capacitor 8 plugin for Conekta card tokenization. Creates single-use payment tokens from card details using the official Conekta JS SDK in a hidden WebView, ensuring PCI compliance and proper device fingerprinting on all platforms.

Based on capacitor-conketa by Jorge Enriquez. Modernized for Capacitor 8 with hidden WebView tokenization approach.

Why This Plugin?

Conekta's web tokenizer (ConektaCheckoutComponents.Card()) uses a zoid-based iframe that does not work on iOS because Capacitor uses the capacitor:// custom URL scheme, and zoid's cross-origin iframe communication fails with non-standard schemes. Setting iosScheme: 'https' is also not viable because WKWebView rejects registering scheme handlers for standard schemes.

This plugin solves the problem by loading the official Conekta JS SDK (conekta.js) inside a hidden WebView on native platforms. The hidden WebView uses https://conekta.com as its base URL, giving the SDK a proper HTTPS origin. This ensures device fingerprinting, anti-fraud data collection, and PCI-compliant tokenization work correctly — without any iframe or URL scheme issues.

Platform Support

| Platform | Min Version | Implementation | | -------- | --------------- | ----------------------------------- | | iOS | 15.0+ | Hidden WKWebView + Conekta JS SDK | | Android | API 23+ | Hidden WebView + Conekta JS SDK | | Web | Modern browsers | Conekta JS SDK (dynamically loaded) |

Install

npm install @technitsolutions/capacitor-conekta-tokenizer
npx cap sync

Usage

import { ConektaTokenizer } from '@technitsolutions/capacitor-conekta-tokenizer';

// 1. Set your Conekta public key
await ConektaTokenizer.setPublicKey({ publicKey: 'key_xxxxxxxxxxxxxxxx' });

// 2. Create a token from card details
const { token } = await ConektaTokenizer.createToken({
  name: 'John Doe',
  cardNumber: '4242424242424242',
  expMonth: '12',
  expYear: '25',
  cvc: '123',
});

console.log('Token ID:', token.id); // tok_xxxxxxxx
console.log('Live mode:', token.livemode);
console.log('Full token:', token);

API

setPublicKey(...)

setPublicKey(options: SetPublicKeyOptions) => Promise<void>

Set the Conekta public API key for tokenization.

| Param | Type | | ------------- | ------------------------------------------------------------------- | | options | SetPublicKeyOptions |

Since: 1.0.0


createToken(...)

createToken(options: CreateTokenOptions) => Promise<CreateTokenResult>

Create a payment token from card details.

Sends card data directly to the Conekta API (POST https://api.conekta.io/tokens) and returns a single-use token ID.

| Param | Type | | ------------- | ----------------------------------------------------------------- | | options | CreateTokenOptions |

Returns: Promise<CreateTokenResult>

Since: 1.0.0


Interfaces

SetPublicKeyOptions

| Prop | Type | Description | Since | | --------------- | ------------------- | --------------------------------------------------- | ----- | | publicKey | string | Your Conekta public API key (e.g., key_xxxxxxxx). | 1.0.0 |

CreateTokenResult

| Prop | Type | Description | Since | | ----------- | ----------------------------------------------------- | ------------------------------ | ----- | | token | ConektaToken | The full Conekta token object. | 1.1.0 |

ConektaToken

| Prop | Type | Description | Since | | -------------- | -------------------- | ------------------------------------------------------- | ----- | | id | string | The single-use payment token ID (e.g., tok_xxxxxxxx). | 1.0.0 | | livemode | boolean | Whether this token was created in live mode. | 1.1.0 | | used | boolean | Whether this token has already been used. | 1.1.0 | | object | string | Object type (always "token"). | 1.1.0 |

CreateTokenOptions

| Prop | Type | Description | Since | | ---------------- | ------------------- | ----------------------------------------------- | ----- | | name | string | Cardholder name as it appears on the card. | 1.0.0 | | cardNumber | string | Card number (digits only, no spaces or dashes). | 1.0.0 | | expMonth | string | Expiration month (e.g., "01" for January). | 1.0.0 | | expYear | string | Expiration year (e.g., "25" or "2025"). | 1.0.0 | | cvc | string | Card verification code (3 or 4 digits). | 1.0.0 |

iOS Setup

No additional setup required. The plugin creates a hidden WKWebView to load the Conekta JS SDK.

Android Setup

No additional setup required. The plugin creates a hidden WebView to load the Conekta JS SDK. The INTERNET permission is declared in the plugin's manifest.

Register the Plugin

In your Capacitor app's MainActivity.java or MainActivity.kt:

import com.technit.capacitor.conekta.ConektaTokenizerPlugin

class MainActivity : BridgeActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        registerPlugin(ConektaTokenizerPlugin::class.java)
        super.onCreate(savedInstanceState)
    }
}

How It Works

Instead of using Conekta's iframe tokenizer (which breaks on Capacitor iOS) or deprecated native SDKs, this plugin:

  1. Creates a hidden WebView (invisible to the user) on plugin load
  2. Loads the official Conekta JS SDK (https://cdn.conekta.io/js/latest/conekta.js) with https://conekta.com as the base URL
  3. When createToken() is called, it executes Conekta.Token.create() inside the hidden WebView
  4. The SDK handles device fingerprinting, PCI compliance, and API communication
  5. The token result is passed back to native code via message handlers

This ensures tokens are created through Conekta's official SDK flow and are accepted for charges.

Acknowledgments

This plugin is based on the original capacitor-conketa by Jorge Enriquez, which provided the foundational architecture for Conekta card tokenization in Capacitor applications. The original plugin targeted Capacitor 2 with native Conekta SDKs.

This modernized version was created and is maintained by Technit Solutions.

License

MIT - See LICENSE for details.