Skip to main content
Version: Next

wasp

The wasp package is the Wasp SDK: the code you import from your app's source files to use Wasp's features, such as operations, auth, and the router.

src/MainPage.tsx
import { useAuth } from "wasp/client/auth";
import { getTasks, useQuery } from "wasp/client/operations";

Each of the modules below is a path you can import from.

Getting the package​

You don't need to install anything, and the package isn't published to npm. The Wasp CLI generates it specifically for your app, based on your Wasp Spec and Prisma schema, and sets it up as a dependency in your project.

Modules​

ModuleDescription
authAuth APIs you can use both on the client and on the server: the AuthUser type of the logged-in user, and helpers for reading auth data from a user entity object.
auth/providersTypes of the extra signup fields you define for your auth methods.
clientRuntime configuration and environment variables of your app's client.
client/apiAn HTTP client for calling your app's server, including your custom APIs.
client/authClient-side auth APIs: getting the logged-in user, logging out, the generated Auth UI components, and the functions and helpers for building your own auth UI.
client/crudClient-side APIs for the Queries and Actions of your Automatic CRUD specs.
client/operationsClient-side APIs for calling your Queries and Actions.
client/routerType-safe links and URLs for the routes you declare in your Wasp Spec.
client/testHelpers for testing your client code with Vitest and React Testing Library. The helper for configuring Vitest is in wasp/test.
client/viteThe Vite plugin that your app's client needs.
client/webSocketReact hooks for using your app's WebSocket server from the client. Only available if your app sets the webSocket field of the app spec.
entitiesTypes for your app's Entities, which you can use on both the server and the client.
envHelper for defining the validation schemas of your app's environment variables.
serverServer-side APIs you can use in your Operations, APIs, Jobs, and server setup code.
server/apiTypes for implementing your app's APIs (custom HTTP endpoints).
server/authServer-side auth APIs: types for your auth hooks, defining extra signup fields, helpers for working with users' auth identities, the validators Wasp uses in its default auth flows, and the OAuth clients of your social auth providers. You can use the helpers and the validators in custom sign-up actions.
server/crudTypes for overriding the Queries and Actions of your Automatic CRUD specs.
server/emailSend emails from your server code.
server/jobsYour app's Jobs, which you can submit from your server code.
server/operationsServer-side APIs for your Queries and Actions: the types for implementing them, and the functions for calling them from other server code.
server/webSocketTypes for implementing your app's WebSocket server with Socket.IO. Only available if your app sets the webSocket field of the app spec.
testThe helper for configuring Vitest to test your client code. The helpers you use inside your tests are in wasp/client/test.