🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@mdedit/sdk

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mdedit/sdk

Official JavaScript SDK for mdedit.ai (authenticated API client).

Source
npmnpm
Version
0.3.4
Version published
Weekly downloads
862
78.1%
Maintainers
1
Weekly downloads
 
Created
Source

@mdedit/sdk

Official JavaScript SDK for mdedit.ai.

This package is designed for authenticated usage: all API access depends on your backend enforcing auth/authz.

Install

npm install @mdedit/sdk

Get an API key

All APIs require authentication. Create an API key here:

  • https://docs.mdedit.ai/api-keys

Usage

import { createSdkClient } from '@mdedit/sdk';

const client = createSdkClient({
  baseUrlV2: 'https://apiv2.mdedit.ai/api',
  getAuthHeaders: async () => ({
    'x-api-key': process.env.MDEDIT_API_KEY!,
  }),
});

const workspaces = await client.workspace.list();

New agent-facing workflows should request mode: 'live'; a Live link follows later durable document edits at the same URL. Use mode: 'snapshot' for a frozen artifact. When updating an existing publication, omit mode to preserve its stored mode.

const publication = await client.publish.publish(workspaceId, articleId, {
  mode: 'live',
});

const status = await client.publish.status(workspaceId, articleId);
console.log({
  url: status.shortUrl,
  mode: status.mode,
  sourceVersionId: status.sourceVersionId,
  syncStatus: status.syncStatus,
  syncError: status.syncError,
});

The SDK exports PublicationMode, PublicationSyncStatus, and PublicationSourceMetadata for typed integrations. Existing links without stored mode metadata are legacy Snapshots until explicitly changed.

Error handling

SDK methods throw FetchError for HTTP errors (includes status).

Semver strategy

Current major version is 0 (pre-1.0.0).

  • 0.x minor versions may include breaking changes.
  • 0.x patch versions are reserved for backwards-compatible fixes.

License

See LICENSE.

Keywords

mdedit

FAQs

Package last updated on 01 Aug 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts