Skip to content

Lovable

Use the Ned TypeScript SDK inside a Lovable project to build AI-powered apps with live Shopify data.

INFO

Lovable doesn't support MCP servers directly. This guide uses the Ned TypeScript SDK to pull data into your Lovable app.

What You'll Need

Step 1: Get Your API Key

  1. Go to app.meetned.com
  2. Open SettingsDeveloper
  3. Click Create API Key
  4. Copy the key

Step 2: Create a Lovable Project

  1. Go to lovable.dev and create a new project

  2. Tell Lovable to install the Ned SDK:

    "Install the @ned-ai/sdk package"

Step 3: Add Your API Key

Set your API key as an environment variable in Lovable's project settings:

  1. Open your project SettingsEnvironment Variables
  2. Add:
    • Key: NED_API_KEY
    • Value: ned_live_YOUR_API_KEY_HERE

WARNING

Never hardcode your API key in the source code. Always use environment variables.

Step 4: Use the SDK

Ask Lovable to build features using the Ned SDK. Here are some prompts to try:

Sales Dashboard

"Build a dashboard that shows today's sales, revenue, and order count using the Ned SDK. Use NedClient from @ned-ai/sdk with the NED_API_KEY env var. Call ned.analytics.getSalesContext({ period: 'today' }) to get the data."

Product Profitability Table

"Create a table showing my top 10 products by profit using the Ned SDK. Call ned.analytics.getProductProfitability({ period: 'this_month', limit: 10, sort: 'profit' }) and display the results."

Marketing Metrics Card

"Add a marketing metrics card that shows MER, CAC, and ROAS using ned.analytics.getMarketingMetrics({ period: 'last_30_days' }) from the Ned SDK."

SDK Quick Reference

typescript
import { NedClient } from '@ned-ai/sdk';

const ned = new NedClient({
  apiKey: process.env.NED_API_KEY
});

// Sales
const sales = await ned.analytics.getSalesContext({ period: 'today' });

// Profitability
const profit = await ned.analytics.getProfitability({ period: 'this_month' });

// Customers
const customers = await ned.analytics.getCustomerSummary({ period: 'this_month' });

// Marketing
const marketing = await ned.analytics.getMarketingMetrics({ period: 'last_30_days' });

See the full SDK documentation for all available methods.

Troubleshooting

"Module not found" error

Make sure the SDK is installed. Ask Lovable:

"Run npm install @ned-ai/sdk"

"Authentication failed"

  • Check that the NED_API_KEY environment variable is set correctly
  • Verify the key starts with ned_live_ and hasn't been revoked

API calls fail at build time

The Ned API must be called server-side or from an API route — not from client-side code in the browser. Ask Lovable to create a server route or API endpoint that calls the SDK.

Need Help?

Built with ❤️ by Ned AI