Open Source • Featured by NativeScript

ns-ai-kit

Bringing Modern AI Capabilities to NativeScript

Role Creator & Lead Developer
Type Open Source SDK
Stack TypeScript • NativeScript
Recognition Featured by Official NativeScript Team

Overview

As AI rapidly becomes an essential part of modern mobile applications, most frameworks have quickly adopted tools that simplify integration with OpenAI, Google, Azure, and similar platforms. However, NativeScript—a framework known for its native performance and developer-friendly approach—had a major gap: there was no easy, standardized, or modern SDK to add AI capabilities into mobile apps.

The Problem: NativeScript developers wanting to build AI-powered features were forced to write custom HTTP integrations, build streaming logic manually, rebuild UI logic to handle conversations, or switch frameworks entirely just to support AI features.

This fragmentation created friction, slowed down innovation, and made AI adoption in NativeScript unnecessarily difficult.

The Challenge

NativeScript developers were increasingly interested in building:

  • In-app AI assistants
  • Intelligent customer support bots
  • Content generation tools
  • Natural-language driven experiences
  • AI-enhanced workflows inside native apps

But they lacked a unified solution that offered:

Clean APIs

Simple, intuitive interfaces that don't require deep AI knowledge

Cross-Provider Support

OpenAI, Google Gemini, Azure, and more

Streamed Responses

Real-time, token-by-token streaming for better UX

NativeScript Integration

Full compatibility with ViewModels and UI components

Native Performance

Lightweight design that doesn't compromise speed

Modern DX

React-like developer experience, adapted for NativeScript

Developers had the skills. NativeScript had the power. What was missing was an SDK designed for this ecosystem.

The Solution: ns-ai-kit

I created @marrocode/ns-ai-kit, a lightweight, flexible, and modern AI integration layer for NativeScript—inspired by the simplicity and elegance of the Vercel AI SDK.

The goal was simple: Bring real AI capabilities into NativeScript, without asking developers to switch stacks, rewrite their apps, or adopt new frameworks.

Key Features

💬

Easy-to-use AI Chat Interfaces

Simple APIs for building conversational experiences

🔌

AI Provider Support

Currently supports OpenAI and Google Gemini (more providers coming soon)

Streaming Out of the Box

Real-time token-by-token responses for better UX

🎯

Event-Based Hooks

Deep customization for advanced use cases

📱

NativeScript Native

Fully compatible with ViewModels & UI components

🚀

Minimal Setup

Get started with just npm install

Developer Experience

The SDK takes care of request formatting, real-time streaming, error handling, and provider compatibility—allowing developers to focus on experience, not infrastructure.

Installation
npm install @marrocode/ns-ai-kit
Simple AI Chat Call
const res = await this.gemini.chatCompletion({
		messages: [{
				role: 'user',
				content: 'Explain NativeScript in one paragraph.'
		}],
});

That's it. No boilerplate, no complex setup, no switching frameworks.

Scalability for Future Use Cases

One of the core design principles of the SDK is scalability. NativeScript apps often start small—an MVP, an internal tool, or a simple feature—and grow into larger systems. ns-ai-kit is built to support this evolution without rewriting or restructuring the codebase.

Start Small

  • A basic chatbot
  • A small Q&A assistant
  • A single AI-powered feature

Scale Up

  • Multi-step reasoning flows
  • AI-powered data extraction
  • Real-time conversational interfaces
  • Context-aware assistants
  • Generative content pipelines
  • Enterprise-grade AI features

All while keeping native performance, thanks to NativeScript's architecture and the SDK's lightweight design.

Who Is This For?

NativeScript Developers

Tired of switching frameworks just to test AI ideas

Startups

Wanting to add intelligence to mobile products quickly

Development Teams

That value native performance but need modern AI tools

Enterprises

Already using NativeScript internally and want AI modernization

Makers & Experimenters

Pushing innovation in cross-platform mobile development

Impact & Recognition

The release of ns-ai-kit filled a long-standing gap in the NativeScript ecosystem. Within days:

👥

Community Adoption

Early adopters began testing and contributing to the project

💡

Strong Interest

Community expressed enthusiasm for expanding AI capabilities in NativeScript

🎨

Developer Experience

Praised for bringing "Vercel-style" DX to the NativeScript world

What This Enables

Most importantly, the SDK empowers teams to:

Stay Within Their Stack

No need to switch frameworks or learn new tools

Build Faster

Prototype and ship AI features without friction

Maintain Performance

Keep native-level speed with minimal overhead

Scale Confidently

Start small and grow into enterprise features

Project Status

📦
Available on NPM

@marrocode/ns-ai-kit

💻
Open Source

View on GitHub

🎯
Production Ready

Stable release with comprehensive documentation

🌟
Community Driven

Open to contributions and feature requests

Technical Highlights

TypeScript First

Built with TypeScript for type safety and excellent IDE support throughout the development experience.

Multi-Provider Support

Currently supports OpenAI and Google Gemini with a unified interface, designed to easily add more providers in the future.

Streaming Architecture

Built-in support for real-time streaming responses, providing smooth, token-by-token output for better user experience.

Lightweight Design

Minimal dependencies and optimized for mobile performance, ensuring fast load times and efficient resource usage.