@codesandbox/api
Version:
The CodeSandbox API
18 lines (17 loc) • 754 B
TypeScript
import type { ClientType } from "./types";
export declare class ServerApi {
private clientType;
constructor(options: {
clientType: ClientType;
});
/**
* On server side we need to produce headers passed to any REST/GQL request based
* on client headers and cookies. As we do not want to create a CodeSandboxApi instance
* for every request, we rather allow to create these headers and pass them to each request
*/
createServerRequestHeaders(clientHeaders: Record<string, string>, clientCookies: Record<string, string>): Record<string, string>;
/**
* Expect to get the headers created by "createServerRequestHeaders"
*/
hasSignedIn(serverRequestHeaders: Record<string, string>): boolean;
}