Magic client SDKs provide Test Mode as a quick way to test your integration locally by asserting specific error codes or bypassing the magic link flow completely.
To enable Test Mode, provide
testMode: true to the SDK constructor.
With Test Mode enabled, you can assert the desired behavior through the email address you provide to
To assert a success state, use
Users created in test mode are ephemeral. It is advised that you do not associate these users to persistent data in your backend. If you are building an integration with cryptocurrency or Web3 features, never deposit money into a test user's account.
To assert a failed state, use
To assert a specific failed state, you can also provide an RPC error code with
You can find a list of relevant RPC error codes here.