Docs

Getting Started for Web

Appwrite is a development platform providing you easy yet powerful API and management console to get your next project up and running quickly.

This tutorial will help you start using Appwrite products and build your next project. If you would like, you can download one of our quickstart samples to get started quickly.

Create Your First Appwrite Project

Login to your Appwrite console or signup for a new account. Once inside your console click the icon in the top navigation header or on the 'Create Project' button. Choose a name for your app and click create to get started.

Add your Web Platform

For you to init your SDK and interact with Appwrite services you need to add a web platform to your project. To add a new platform, go to your console, choose the project you created in the step before and click the 'Add Platform' button.

From the options, choose to add a web platform and add your project production and development domains in the form clients field. By adding your domain to your project platform you are allowing cross-domain communication between your project and Appwrite servers

Get Appwrite JS SDK

Use JS package manager, NPM from your command line to add Appwrite SDK to your project.

npm install appwrite

Init your SDK

Initialize your SDK code with your project ID which can be found in your project settings page.

// Init your JS SDK
var appwrite = new window.Appwrite();

appwrite
    .setProject('455x34dfkj')

Make Your First Request

Once your SDK object is set, access any of the Appwrite services and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the API References section.

// Login User
appwrite.users.login('me@example.com', 'password')
        .then(function() {
            alert('Login Succeed');
        }, function() {
            alert('Login Failed');
        });

Full Example

// Init your JS SDK
var appwrite = new window.Appwrite();

appwrite
    .setProject('455x34dfkj');

// Login User
appwrite.users.login('me@example.com', 'password')
        .then(function() {
            alert('Login Succeed');
        }, function() {
            alert('Login Failed');
        });