Skip to main content
arkffi lets you call C functions from native .so libraries directly from ArkTS — no NAPI bindings required.

Getting Started

Install, configure, and call your first C function in minutes.

API Reference

Complete reference for dlopen, FFIType, CString, CFunction, and JSCallback.

Guides

Deep dives into mixed types, function pointers, callbacks, and external libraries.

Overview

arkffi provides three layers of abstraction:

Features

  • Call any exported C function from a .so library
  • Supports int32, int64, double, float, bool, pointer, cstring, callback
  • Mixed parameter types (int + double + string in one call)
  • Function pointer support via CFunction
  • JavaScript callbacks via JSCallback with optional threadsafe mode
  • C string reading via CString
  • TypeScript generics for IDE code completion

Quick Start

Architecture

Installation