account.createMagicLink
import { Client, Orvano } from '@orvano/js'
const orvano = new Orvano(new Client({ endpoint: 'https://orvano.example.com' }))
await orvano.account.createMagicLink({ email: 'ada@example.com', redirectUrl: 'https://app.example.com/auth/callback',})// app/page.tsx, a server component. Route handlers and server actions use createServerClient too.import { cookies } from 'next/headers'import { createServerClient } from '@orvano/nextjs'
export default async function Page() { const orvano = createServerClient({ endpoint: process.env.ORVANO_ENDPOINT!, cookies: await cookies(), }) await orvano.account.createMagicLink({ email: 'ada@example.com', redirectUrl: 'https://app.example.com/auth/callback', }) return <p>Done</p>}import 'package:orvano_flutter/orvano_flutter.dart';
Future<void> main() async { final orvano = Orvano(Client(endpoint: 'https://orvano.example.com')); await orvano.account.createMagicLink( CreateMagicLinkRequest( email: 'ada@example.com', redirectUrl: 'https://app.example.com/auth/callback', ), );}Emails a sign in link. An email without a user gets one that creates the user, unless createUser is false. The
answer is the same 202 either way, so it never tells anyone which emails have accounts.
Client SDKs: JavaScript in the browser, Next.js, and Flutter call it for the signed in user, or with no credential. A failure answers with a problem details body; its code has a page under Errors.
Request Bodyrequired
Section titled “Request Bodyrequired”A request to email a sign in link.
object
The email to sign in as; case does not matter.
Your page that receives the link, on a host that is one of the project’s web platforms (http only on
localhost or 127.0.0.1). The link adds orvano_type=magic_link and orvano_token to it.
Whether the link may create a user for an email that has none. Defaults to true.
Responses
Section titled “Responses”The request has been accepted for processing, but processing has not yet completed.
default
Section titled “default”An unexpected error response.
An RFC 9457 problem details body. Every operation declares it as its default response, sent
as application/problem+json.
object
Identifies the error: https://orvano.dev/errors/<code>.
The standard HTTP reason phrase for the status.
The HTTP status code.
A short, safe sentence about this occurrence, when the server has one.
Orvano’s stable error code, from the ErrorCode catalog. SDKs treat it as a plain string.
The request ID to quote when reporting a problem; also sent as X-Request-Id.
Example
{ "type": "https://orvano.dev/errors/not_found", "title": "Not Found", "status": 404, "code": "not_found", "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"}