From ns-tools
Implement NS Auth (Network School authentication) in any project. Use when the user mentions 'NS Auth', 'Network School login', 'Login with NS', 'NS membership verification', 'Discord NS verify', or wants to gate access to NS members. Provides the full API reference, code examples, and guides integration step by step.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ns-tools:ns-authThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are helping the user integrate **NS Auth**, the Network School Discord membership verification API. Follow this documentation exactly. Do not hallucinate endpoints, fields, or scopes.
You are helping the user integrate NS Auth, the Network School Discord membership verification API. Follow this documentation exactly. Do not hallucinate endpoints, fields, or scopes.
Verify a Discord user's NS membership.
Important: The trailing slash is required. Without it, the server returns a 301 redirect which causes
fetchto downgrade POST to GET, resulting in a 405 error.
Headers
| Header | Required | Description |
|---|---|---|
X-Api-Key | Yes | Your API key (starts with nsauth_) |
Content-Type | Yes | application/json |
Request Body
{
"discordId": "<discord-user-id>"
}
Response — Member
{
"member": true,
"discordId": "...",
"discordUsername": "john",
"discordAvatar": "abc123hash",
"roles": ["Core"],
"userType": "core",
"name": "John Doe",
"username": "john_ns",
"email": "[email protected]"
}
Fields returned depend on the app's approved scopes. Fields may be null if the user hasn't linked their Discord on ns.com.
Response — Not a Member
{
"member": false
}
Error Responses
| Status | Meaning |
|---|---|
| 400 | Missing or invalid discordId |
| 401 | Missing or invalid API key |
| 403 | App not approved or deactivated |
| 429 | Rate limit exceeded (20 requests/minute) |
| 502 | Discord API error — try again later |
Apps are assigned scopes during approval. These control what data is returned.
| Scope | Data |
|---|---|
membership | member (true/false), discordId — always included |
roles | roles (Discord server roles), userType (core, longterm, member, etc.) |
profile | name, username, discordUsername, discordAvatar |
email | email (if available) |
When helping the user integrate NS Auth:
NS_AUTH_API_KEY in frontend code or client bundles. If the user's stack is client-only (e.g., SPA), they need a backend proxy route.identify.NS_AUTH_API_KEY.member === true before granting access. Do not trust other fields without checking membership first.import NextAuth from "next-auth";
import DiscordProvider from "next-auth/providers/discord";
export const { handlers, auth } = NextAuth({
providers: [
DiscordProvider({
clientId: process.env.DISCORD_CLIENT_ID!,
clientSecret: process.env.DISCORD_CLIENT_SECRET!,
}),
],
callbacks: {
async signIn({ profile }) {
const res = await fetch("https://api.ns.com/api/v1/ns-auth/verify/", {
method: "POST",
headers: {
"X-Api-Key": process.env.NS_AUTH_API_KEY!,
"Content-Type": "application/json",
},
body: JSON.stringify({ discordId: profile?.id }),
});
const data = await res.json();
return data.member === true;
},
},
});
app.post("/api/ns-verify", async (req, res) => {
const { discordId } = req.body;
const response = await fetch("https://api.ns.com/api/v1/ns-auth/verify/", {
method: "POST",
headers: {
"X-Api-Key": process.env.NS_AUTH_API_KEY!,
"Content-Type": "application/json",
},
body: JSON.stringify({ discordId }),
});
const data = await response.json();
res.json(data);
});
import os
import requests
NS_AUTH_API_KEY = os.environ["NS_AUTH_API_KEY"]
def verify_ns_membership(discord_id: str) -> dict:
response = requests.post(
"https://api.ns.com/api/v1/ns-auth/verify/",
headers={
"X-Api-Key": NS_AUTH_API_KEY,
"Content-Type": "application/json",
},
json={"discordId": discord_id},
)
response.raise_for_status()
return response.json()
// Frontend — calls YOUR backend, not NS Auth directly
async function verifyNSMembership(discordId: string) {
const res = await fetch("/api/ns-verify", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ discordId }),
});
return res.json();
}
member === true before granting access.For questions or help: [email protected] To register a new app: ns.com/platform
$ARGUMENTS
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub 0xvitae/ns-tools-atlas --plugin ns-tools