Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@instantdb/admin

Package Overview
Dependencies
Maintainers
0
Versions
196
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@instantdb/admin - npm Package Compare versions

Comparing version 0.14.10 to 0.14.11

17

dist/index.d.ts

@@ -171,2 +171,19 @@ import { tx, lookup, i, id, type TransactionChunk, type AuthToken, type Exactly, type User, type Query, type QueryResponse, type InstaQLQueryParams, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantSchemaDatabase, type InstantObject, type InstantEntity, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type ValueTypes } from "@instantdb/core";

/**
* Generates a magic code for the user with the given email, used to sign in on the frontend.
* This is useful for writing custom auth flows.
*
* @example
* try {
* const user = await db.auth.generateMagicCode({ email })
* // send an email to user with magic code
* } catch (err) {
* console.error("Failed to generate magic code:", err.message);
* }
*
* @see https://instantdb.com/docs/backend#generate-magic-code
*/
generateMagicCode: (email: string) => Promise<{
code: string;
}>;
/**
* Creates a login token for the user with the given email.

@@ -173,0 +190,0 @@ * If that user does not exist, we create one.

@@ -261,2 +261,23 @@ "use strict";

/**
* Generates a magic code for the user with the given email, used to sign in on the frontend.
* This is useful for writing custom auth flows.
*
* @example
* try {
* const user = await db.auth.generateMagicCode({ email })
* // send an email to user with magic code
* } catch (err) {
* console.error("Failed to generate magic code:", err.message);
* }
*
* @see https://instantdb.com/docs/backend#generate-magic-code
*/
this.generateMagicCode = (email) => __awaiter(this, void 0, void 0, function* () {
return jsonFetch(`${this.config.apiURI}/admin/magic_code`, {
method: "POST",
headers: authorizedHeaders(this.config),
body: JSON.stringify({ email }),
});
});
/**
* Creates a login token for the user with the given email.

@@ -263,0 +284,0 @@ * If that user does not exist, we create one.

@@ -171,2 +171,19 @@ import { tx, lookup, i, id, type TransactionChunk, type AuthToken, type Exactly, type User, type Query, type QueryResponse, type InstaQLQueryParams, type InstantQuery, type InstantQueryResult, type InstantSchema, type InstantSchemaDatabase, type InstantObject, type InstantEntity, type AttrsDefs, type CardinalityKind, type DataAttrDef, type EntitiesDef, type EntitiesWithLinks, type EntityDef, type InstantGraph, type LinkAttrDef, type LinkDef, type LinksDef, type ResolveAttrs, type ValueTypes } from "@instantdb/core";

/**
* Generates a magic code for the user with the given email, used to sign in on the frontend.
* This is useful for writing custom auth flows.
*
* @example
* try {
* const user = await db.auth.generateMagicCode({ email })
* // send an email to user with magic code
* } catch (err) {
* console.error("Failed to generate magic code:", err.message);
* }
*
* @see https://instantdb.com/docs/backend#generate-magic-code
*/
generateMagicCode: (email: string) => Promise<{
code: string;
}>;
/**
* Creates a login token for the user with the given email.

@@ -173,0 +190,0 @@ * If that user does not exist, we create one.

@@ -252,2 +252,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

/**
* Generates a magic code for the user with the given email, used to sign in on the frontend.
* This is useful for writing custom auth flows.
*
* @example
* try {
* const user = await db.auth.generateMagicCode({ email })
* // send an email to user with magic code
* } catch (err) {
* console.error("Failed to generate magic code:", err.message);
* }
*
* @see https://instantdb.com/docs/backend#generate-magic-code
*/
this.generateMagicCode = (email) => __awaiter(this, void 0, void 0, function* () {
return jsonFetch(`${this.config.apiURI}/admin/magic_code`, {
method: "POST",
headers: authorizedHeaders(this.config),
body: JSON.stringify({ email }),
});
});
/**
* Creates a login token for the user with the given email.

@@ -254,0 +275,0 @@ * If that user does not exist, we create one.

4

package.json
{
"name": "@instantdb/admin",
"version": "v0.14.10",
"version": "v0.14.11",
"description": "Admin SDK for Instant DB",

@@ -28,4 +28,4 @@ "main": "dist/index.js",

"dependencies": {
"@instantdb/core": "v0.14.10"
"@instantdb/core": "v0.14.11"
}
}

@@ -379,2 +379,24 @@ import {

/**
* Generates a magic code for the user with the given email, used to sign in on the frontend.
* This is useful for writing custom auth flows.
*
* @example
* try {
* const user = await db.auth.generateMagicCode({ email })
* // send an email to user with magic code
* } catch (err) {
* console.error("Failed to generate magic code:", err.message);
* }
*
* @see https://instantdb.com/docs/backend#generate-magic-code
*/
generateMagicCode = async (email: string): Promise<{ code: string }> => {
return jsonFetch(`${this.config.apiURI}/admin/magic_code`, {
method: "POST",
headers: authorizedHeaders(this.config),
body: JSON.stringify({ email }),
});
};
/**
* Creates a login token for the user with the given email.

@@ -381,0 +403,0 @@ * If that user does not exist, we create one.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc