Guides/TikTok / Next.js

Post to TikTok from Next.js

Aether is pre-approved on TikTok. You skip the weeks-long developer app review and publish from a Route Handler.

~20 minNext.js 14+TikTok creator account
Prerequisites
  • Next.js 14+ App Router project
  • A TikTok account that can post
  • • An Aether account — free, no credit card

Step 1Install the SDK

Add aether to the Next.js project. Keep the API key on the server only.

npm install aether

Step 2Server-only client

Create a singleton used by Route Handlers and Server Actions — never import it in a client component.

// lib/aether.ts
import Aether from "aether";

export const aether = new Aether({
  apiKey: process.env.AETHER_API_KEY!,
});

Step 3Connect TikTok with a Connect Link

This Route Handler starts OAuth. TikTok redirects back to your callback URL with the new profileId.

// app/api/tiktok/connect/route.ts
import { NextResponse } from "next/server";
import { aether } from "@/lib/aether";

export async function GET() {
  const link = await aether.connectLinks.create({
    platform: "tiktok",
    redirectUrl: `${process.env.NEXT_PUBLIC_APP_URL}/api/tiktok/callback`,
  });
  return NextResponse.redirect(link.url);
}

Step 4Publish a video

Pass a publicly reachable MP4 URL. Aether handles TikTok's upload session; you send one posts.create() call.

// app/api/tiktok/post/route.ts
import { NextResponse } from "next/server";
import { aether } from "@/lib/aether";

export async function POST() {
  const post = await aether.posts.create({
    text: "Shipped in Next.js — no TikTok developer app.",
    profileIds: ["tt_xyz789"],
    mediaUrls: ["https://your-cdn.com/clip.mp4"],
  });
  return NextResponse.json(post.data);
}

Step 5Schedule instead of posting now

Add scheduledFor. TikTok still processes the video at publish time; the webhook tells you when it is live.

await aether.posts.create({
  text: "Queued for peak hours.",
  profileIds: ["tt_xyz789"],
  mediaUrls: ["https://your-cdn.com/clip.mp4"],
  scheduledFor: "2026-08-21T18:00:00Z",
});
What you've covered
  • No TikTok developer-app review
  • Connect Link OAuth in a Route Handler
  • Video publish + schedule via posts.create()

Start building

Free API key — 3 connected accounts, all endpoints, no credit card.