New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

apptyped

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apptyped

A fully typed Appwrite SDK for both client-side and server-side Javascript.

latest
Source
npmnpm
Version
1.0.8
Version published
Maintainers
1
Created
Source

Apptyped

This is a package that creates a fully typed SDK based on your Appwrite collections

Install using npm install apptyped

  • Create .env with the following:
    • APPWRITE_ENDPOINT - The endpoint of your Appwrite instance
    • APPWRITE_PROJECT_ID - The ID of your Appwrite project
    • APPWRITE_API_KEY - An Appwrite API key is required to generate the types from your collections as well as using the server-side client
  • Run npx apptyped g to generate the fully typed SDK

This SDK is compatible with Appwrite server version 1.4.x

Example

// Import location will depend on if you're using it for server-side or client-side
// Server-side SDK import
import { Databases, Client } from 'apptyped/server'
// Client-side SDK import
import { Databases, Client } from 'apptyped/client';

const client = new Client();
// Databases will return as an object of all your collections which can be access as shown below
const { BlogPosts } = new Databases(client);

// Fully typed queries can be accessed from .q of each collection
const data = await BlogPosts.list([
    BlogPosts.q.equal("published", true),
]);

Keywords

appwrite

FAQs

Package last updated on 28 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts