← Back to Skills Marketplace
urbantech

Ainative Vue Sdk

by Toby Morning · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
114
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install ainative-vue-sdk
Description
Use @ainative/vue-sdk to add AI chat to Vue 3 apps. Use when (1) Installing @ainative/vue-sdk, (2) Using the useChat composable in Vue components, (3) Provid...
README (SKILL.md)

@ainative/vue-sdk

Vue 3 composables for AINative chat completions.

Install

npm install @ainative/vue-sdk

Setup: provideAINative

// main.ts
import { createApp } from 'vue';
import { provideAINative } from '@ainative/vue-sdk';
import App from './App.vue';

const app = createApp(App);

app.provide('ainative', {
  apiKey: import.meta.env.VITE_AINATIVE_API_KEY,
  baseUrl: 'https://api.ainative.studio',
});

app.mount('#app');

Or provide inside a component:

\x3Cscript setup>
import { provideAINative } from '@ainative/vue-sdk';
provideAINative({ apiKey: import.meta.env.VITE_AINATIVE_API_KEY });
\x3C/script>

useChat Composable

\x3C!-- ChatComponent.vue -->
\x3Cscript setup lang="ts">
import { ref } from 'vue';
import { useChat } from '@ainative/vue-sdk';
import type { Message } from '@ainative/vue-sdk';

const { messages, isLoading, error, sendMessage, reset } = useChat({
  model: 'claude-3-5-sonnet-20241022',
  initialMessages: [],
});

const input = ref('');

async function send() {
  if (!input.value.trim()) return;
  const newMessages: Message[] = [
    ...messages.value,
    { role: 'user', content: input.value }
  ];
  input.value = '';
  await sendMessage(newMessages);
}
\x3C/script>

\x3Ctemplate>
  \x3Cdiv>
    \x3Cdiv v-for="(msg, i) in messages" :key="i" :class="['message', msg.role]">
      \x3Cstrong>{{ msg.role }}:\x3C/strong> {{ msg.content }}
    \x3C/div>

    \x3Cdiv v-if="isLoading">Thinking...\x3C/div>
    \x3Cdiv v-if="error" class="error">Error: {{ error.message }}\x3C/div>

    \x3Cinput
      v-model="input"
      @keydown.enter="send"
      placeholder="Type a message..."
    />
    \x3Cbutton @click="send" :disabled="isLoading">Send\x3C/button>
    \x3Cbutton @click="reset">Reset\x3C/button>
  \x3C/div>
\x3C/template>

useChat Options

Option Type Default Description
model string Model ID (e.g. claude-3-5-sonnet-20241022)
initialMessages Message[] [] Seed the conversation

useChat Return

Field Type Description
messages Ref\x3CMessage[]> Reactive message list
isLoading Ref\x3Cboolean> True during request
error Ref\x3CAINativeError | null> Last error
sendMessage (msgs: Message[]) => Promise\x3C...> Send next turn
reset () => void Clear conversation

useCredits Composable

\x3Cscript setup>
import { useCredits } from '@ainative/vue-sdk';
const { balance, isLoading, error, refetch } = useCredits();
\x3C/script>

\x3Ctemplate>
  \x3Cdiv v-if="!isLoading">
    Credits: {{ balance?.remaining_credits }} | Plan: {{ balance?.plan }}
    \x3Cbutton @click="refetch">Refresh\x3C/button>
  \x3C/div>
\x3C/template>

Nuxt Integration

// plugins/ainative.client.ts
import { provideAINative } from '@ainative/vue-sdk';
export default defineNuxtPlugin(() => {
  provideAINative({ apiKey: useRuntimeConfig().public.ainativeApiKey });
});
// nuxt.config.ts
export default defineNuxtConfig({
  runtimeConfig: {
    public: { ainativeApiKey: process.env.VITE_AINATIVE_API_KEY }
  }
});

Exports

import {
  useChat,
  useCredits,
  useAINative,
  provideAINative,
  type Message,
  type UseChatOptions,
  type UseChatReturn,
  type AINativeError,
} from '@ainative/vue-sdk';

References

  • packages/sdks/vue/src/composables/useChat.ts — useChat implementation
  • packages/sdks/vue/src/composables/useCredits.ts — useCredits implementation
  • packages/sdks/vue/src/composables/useAINative.ts — Config injection
  • packages/sdks/vue/src/index.ts — Package exports
Usage Guidance
This skill's README looks like ordinary usage documentation for a Vue SDK, but be aware of two points before installing/using it: (1) The examples require an AINative API key and send chat data to https://api.ainative.studio — confirm you trust that service and its privacy practices. (2) The skill metadata does not declare the API key as a required env var; that mismatch could be an oversight. Do these steps before proceeding: verify the npm package @ainative/vue-sdk exists on the public registry and inspect its source (or GitHub repo/homepage) to ensure code matches the docs; don't embed secret keys in client-bundled public env values — prefer a server-side proxy or keep keys in server-only envs; review network endpoints the package calls; and only install if you trust the package owner and the API endpoint. If you want higher assurance, ask the publisher for a repository/homepage and audit the package contents.
Capability Assessment
Purpose & Capability
The name/description match the instructions: the document describes installing an @ainative/vue-sdk and using its Vue 3 composables (useChat, useCredits, provideAINative). That purpose is consistent with the content. However, the examples clearly expect an AINative API key (import.meta.env.VITE_AINATIVE_API_KEY / runtimeConfig public values) even though the skill metadata declares no required environment variables or primary credential.
Instruction Scope
The SKILL.md stays within scope: it shows npm install, import and usage examples, and references api.ainative.studio as the API endpoint. It does not instruct reading arbitrary system files or unrelated credentials. Minor scope issue: it directs the developer to place an API key in client-side env examples (VITE_ / public runtimeConfig) which has security implications and is not declared in the skill metadata.
Install Mechanism
There is no install spec in the skill bundle (instruction-only). The README recommends 'npm install @ainative/vue-sdk', which is a standard, low-risk package install path. No downloads from arbitrary URLs or archive extraction are present in the skill metadata.
Credentials
The SKILL.md demonstrates use of an AINative API key (VITE_AINATIVE_API_KEY / runtimeConfig.public.ainativeApiKey) to call https://api.ainative.studio, but the skill metadata lists no required environment variables or primary credential. The SDK legitimately needs an API key to function — the metadata omission is an inconsistency and a practical concern. There are no other unrelated credentials requested.
Persistence & Privilege
Flags show always: false and no special privileges. The skill is instruction-only and does not request persistent presence or system-wide configuration changes.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install ainative-vue-sdk
  3. After installation, invoke the skill by name or use /ainative-vue-sdk
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of ainative-vue-sdk. - Adds Vue 3 composables for integrating AINative chat completions in Vue apps. - Provides useChat and useCredits composables for chat functionality and credit balance. - Includes provideAINative helper for configuration injection. - Features complete setup instructions, usage examples, and Nuxt integration guidance. - Type definitions and primary API surface exported for use in Vue projects.
Metadata
Slug ainative-vue-sdk
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is Ainative Vue Sdk?

Use @ainative/vue-sdk to add AI chat to Vue 3 apps. Use when (1) Installing @ainative/vue-sdk, (2) Using the useChat composable in Vue components, (3) Provid... It is an AI Agent Skill for Claude Code / OpenClaw, with 114 downloads so far.

How do I install Ainative Vue Sdk?

Run "/install ainative-vue-sdk" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Ainative Vue Sdk free?

Yes, Ainative Vue Sdk is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Ainative Vue Sdk support?

Ainative Vue Sdk is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Ainative Vue Sdk?

It is built and maintained by Toby Morning (@urbantech); the current version is v1.0.0.

💬 Comments