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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@marrocode/ns-ai-kit

v0.0.31

Published

AI Kit for NativeScript

Readme

⚡ NativeScript AI SDK (Inspired by Vercel AI SDK)

Finally, bring real AI power into the NativeScript world — without switching tools, frameworks, or your damn stack.


🚀 Why This Plugin?

You're a NativeScript dev. You love the ecosystem. You build fast, native apps with a clean codebase.

But when it comes to AI, everything gets complicated. You look around and see cool things in React Native, Vercel, and other stacks… And you wonder:

“Why can’t I just do this with the tools I already love?”

Now you can.

This plugin brings you the simplicity and flexibility of the Vercel AI SDK, but built for NativeScript.

Because you shouldn't have to abandon your tech stack just to add some damn intelligence to your app.


🧠 What You Get

  • Easy AI-powered chat interfaces
  • Built-in support for OpenAI, Azure, and more (via edge APIs)
  • Streamed responses out of the box
  • Event-based hooks you can customize
  • Works perfectly with NativeScript's ViewModels and UI components

📦 Installation

npm install @marrocode/ns-ai-kit

🔧 Basic Usage

import { Observable } from '@nativescript/core';
import { GeminiAPI, HttpError } from '@marrocode/ns-ai-kit';

export class MainViewModel extends Observable {
  message: string = 'Presiona el botón para hacer una pregunta a la API de Gemini.';
  private gemini: GeminiAPI;
  private isLoading = false;

  constructor() {
    super();
    const apiKey = "TU_API_KEY_DE_GOOGLE_AI";
    this.gemini = new GeminiAPI(apiKey); 
  }

 
  public async viewDemo() {
    console.log("¡El método viewDemo SÍ fue llamado!");
    if (this.isLoading) {
      return; 
    }

    this.isLoading = true;
    this.set('message', 'Pensando...'); 
    try {
      const res = await this.gemini.chatCompletion({
        messages: [{ role: 'user', content: 'Explica qué es NativeScript en un párrafo corto.' }],
      });

      const reply = res.candidates[0]?.content.parts[0]?.text;
      this.set('message', reply || 'No se recibió una respuesta válida.');

    } catch (error) {
      console.error("Error con la API de Gemini:", error);
      let errorMessage = 'Ocurrió un error al contactar a la API.';
      if (error instanceof HttpError) {
        errorMessage = `Error ${error.statusCode}: ${error.message}`;
      }
      this.set('message', errorMessage);
    } finally {
      this.isLoading = false; 
    }
  }
}

🛠 Example Use Cases

  • Build in-app AI assistants
  • Let users chat with support bots
  • Generate content with OpenAI
  • Create dynamic forms or experiences with natural language

🤘 Who This Is For

  • NativeScript devs tired of switching stacks just to "try AI"
  • Makers who want control without the noise
  • Devs who believe NativeScript should evolve — and are ready to push it forward

⚠️ Early Version Notice

This is the first release. It's still too early to use in production — I literally just published it.

But if you're curious, bold, or just tired of waiting for NativeScript to catch up with AI, dive in.

Break things. Improve stuff.

Open issues. Send PRs. Let’s build the damn future together.

Because innovation doesn’t come from sitting around waiting for someone else to do it.


📢 Contribute

Ideas? Bugs? Want to push this further?

Open an issue or fork it. You’re more than welcome.


❤️ Built with love (and frustration) by someone who got tired of switching frameworks just to add a chat box.