Update errors in docs
This commit is contained in:
@@ -1,12 +1,75 @@
|
||||
<div class="section">
|
||||
<h2 id="getting-started">Docs</h2>
|
||||
<h2>Docs</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="/docs/getting-started" class="font-semibold">Getting started</a></li>
|
||||
<li><a href="/docs/sdk" class="font-semibold">SDK</a></li>
|
||||
<li><a href="#getting-started" class="font-semibold">Getting started</a></li>
|
||||
<li><a href="#sdk" class="font-semibold">SDK</a></li>
|
||||
<li><a href="https://github.com/encrypted-dev/userbase/blob/ugliest-tutorial/docs/examples/ugliest-todo-app/tutorial.md" class="font-semibold">Tutorial</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="section">
|
||||
<a class="anchor" id="getting-started"></a>
|
||||
<h2 id=>Getting Started</h2>
|
||||
|
||||
<h3>Create a free Userbase account</h3>
|
||||
<p>First you need a Userbase account. You will be able to create a free account when Userbase gets launched. No credit card required.</p>
|
||||
|
||||
<h3>Install the SDK</h3>
|
||||
<p>Then you need to include the Userbase SDK into your web app.</p>
|
||||
<p>You can either include the SDK with a <script> tag:</p>
|
||||
|
||||
<pre>
|
||||
<code class="language-html"><script type="text/javascript"
|
||||
src="https://userbase-public.s3-us-west-2.amazonaws.com/userbase-js/userbase.js">
|
||||
</script></code>
|
||||
</pre>
|
||||
|
||||
<p>Or else you can include the SDK into your build pipeline:</p>
|
||||
|
||||
<pre>
|
||||
<code class="language-bash">npm --install --save userbase-js</code>
|
||||
</pre>
|
||||
|
||||
<h3>Set the Application ID</h3>
|
||||
<p>From your Userbase account, create a new App and get the Application ID. Then you just need to configure the Userbase SDK to use it:</p>
|
||||
|
||||
<pre>
|
||||
<code class="language-bash">userbase.configure({ appId: 'a43ae910-fc89-43fe-a7a3-a11a53b49325' })</code>
|
||||
</pre>
|
||||
|
||||
<p>And you're all set.</p>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="section">
|
||||
<a class="anchor" id="sdk"></a>
|
||||
<h2>SDK</h2>
|
||||
|
||||
<p>You can use Userbase through a simple JavaScript SDK in the browser. The following is the complete set of Userbase APIs that let you create user accounts, handle logins, and persist user data.</p>
|
||||
|
||||
<h3 id="zero-management-database">Users</h3>
|
||||
<p>Use these APIs to create user accounts, handle logins and logouts, and resume sessions when a user returns to your web app.</p>
|
||||
<ul>
|
||||
<li><a href="/docs/sdk/sign-up" class="font-semibold">SignUp</a></li>
|
||||
<li><a href="/docs/sdk/sign-in" class="font-semibold">SignIn</a></li>
|
||||
<li><a href="/docs/sdk/sign-in-with-session" class="font-semibold">SignInWithSession</a></li>
|
||||
<li><a href="/docs/sdk/sign-out" class="font-semibold">SignOut</a></li>
|
||||
</ul>
|
||||
|
||||
<h3 id="user-accounts">Data</h3>
|
||||
<p>Use these APIs to store and retrieve user data. All data handled by these APIs is highly-durable, immediately consistent, and end-to-end encrypted.</p>
|
||||
<ul>
|
||||
<li><a href="/docs/sdk/open-database" class="font-semibold">OpenDatabase</a></li>
|
||||
<li><a href="/docs/sdk/insert" class="font-semibold">Insert</a></li>
|
||||
<li><a href="/docs/sdk/update" class="font-semibold">Update</a></li>
|
||||
<li><a href="/docs/sdk/delete" class="font-semibold">Delete</a></li>
|
||||
<li><a href="/docs/sdk/transaction" class="font-semibold">Transaction</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
@@ -1,33 +0,0 @@
|
||||
<div class="section">
|
||||
<h2><a href="/docs">Docs</a> : Getting Started</h2>
|
||||
|
||||
<h3>Create a free Userbase account</h3>
|
||||
<p>First you need a Userbase account. You will be able to create a free account when Userbase gets launched. No credit card required.</p>
|
||||
|
||||
<h3>Install the SDK</h3>
|
||||
<p>Then you need to include the Userbase SDK into your web app.</p>
|
||||
<p>You can either include the SDK with a <script> tag:</p>
|
||||
|
||||
<pre>
|
||||
<code class="language-html"><script type="text/javascript"
|
||||
src="https://userbase-public.s3-us-west-2.amazonaws.com/userbase-js/userbase.js">
|
||||
</script></code>
|
||||
</pre>
|
||||
|
||||
<p>Or else you can include the SDK into your build pipeline:</p>
|
||||
|
||||
<pre>
|
||||
<code class="language-bash">npm --install --save userbase-js</code>
|
||||
</pre>
|
||||
|
||||
<h3>Set the Application ID</h3>
|
||||
<p>From your Userbase account, create a new App and get the Application ID. Then you just need to configure the Userbase SDK to use it:</p>
|
||||
|
||||
<pre>
|
||||
<code class="language-bash">userbase.configure({ appId: 'a43ae910-fc89-43fe-a7a3-a11a53b49325' })</code>
|
||||
</pre>
|
||||
|
||||
<p>And you're all set.</p>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
@@ -1,26 +0,0 @@
|
||||
<div class="section">
|
||||
<h2><a href="/docs">Docs</a> : SDK</h2>
|
||||
|
||||
<p>You can use Userbase through a simple JavaScript SDK in the browser. The following is the complete set of Userbase APIs that let you create user accounts, handle logins, and persist user data.</p>
|
||||
|
||||
<h3 id="zero-management-database">Users</h3>
|
||||
<p>Use these APIs to create user accounts, handle logins and logouts, and resume sessions when a user returns to your web app.</p>
|
||||
<ul>
|
||||
<li><a href="/docs/sdk/sign-up" class="font-semibold">SignUp</a></li>
|
||||
<li><a href="/docs/sdk/sign-in" class="font-semibold">SignIn</a></li>
|
||||
<li><a href="/docs/sdk/sign-in-with-session" class="font-semibold">SignInWithSession</a></li>
|
||||
<li><a href="/docs/sdk/sign-out" class="font-semibold">SignOut</a></li>
|
||||
</ul>
|
||||
|
||||
<h3 id="user-accounts">Data</h3>
|
||||
<p>Use these APIs to store and retrieve user data. All data handled by these APIs is highly-durable, immediately consistent, and end-to-end encrypted.</p>
|
||||
<ul>
|
||||
<li><a href="/docs/sdk/open-database" class="font-semibold">OpenDatabase</a></li>
|
||||
<li><a href="/docs/sdk/insert" class="font-semibold">Insert</a></li>
|
||||
<li><a href="/docs/sdk/update" class="font-semibold">Update</a></li>
|
||||
<li><a href="/docs/sdk/delete" class="font-semibold">Delete</a></li>
|
||||
<li><a href="/docs/sdk/transaction" class="font-semibold">Transaction</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="section">
|
||||
<h2><a href="/docs">Docs</a> : <a href="/docs/sdk">SDK</a> : Delete</h2>
|
||||
<h2><a href="/docs/#sdk">SDK</a> : Delete</h2>
|
||||
|
||||
<p><span class="font-semibold">Delete</span> lets your delete an item from a user's database. This API with will return a promise that gets resolved once the item has been durably deleted from the database.</p>
|
||||
|
||||
@@ -26,11 +26,15 @@
|
||||
|
||||
<ul>
|
||||
<li>DatabaseNotOpen</li>
|
||||
<li>DatabaseNameCannotBeBlank</li>
|
||||
<li>DatabaseNameTooLong</li>
|
||||
<li>DatabaseNameMustBeString</li>
|
||||
<li>ItemIdCannotBeBlank</li>
|
||||
<li>ItemIdMustBeString</li>
|
||||
<li>ItemDoesNotExist</li>
|
||||
<li>UpdateConflict</li>
|
||||
<li>ItemUpdateConflict</li>
|
||||
<li>AppIdNotSet</li>
|
||||
<li>AppIdNotValid</li>
|
||||
<li>ServiceUnavailable</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<div class="section">
|
||||
<h2><a href="/docs">Docs</a> : <a href="/docs/sdk">SDK</a> : Insert</h2>
|
||||
<h2><a href="/docs/#sdk">SDK</a> : Insert</h2>
|
||||
|
||||
<p><span class="font-semibold">Insert</span> lets your add items to a user's database. This API with will return a promise that gets resolved once the item has been durably inserted into the database.</p>
|
||||
|
||||
<pre>
|
||||
<code class="language-javascript">userbase.insert(databaseName, itemId, item)
|
||||
<code class="language-javascript">userbase.insert(databaseName, item, itemId)
|
||||
.then(() => {
|
||||
// item inserted
|
||||
})
|
||||
@@ -21,7 +21,7 @@
|
||||
<span class="field">itemId</span> [string | Len: 1-100] - The item's unique identifier.
|
||||
</li>
|
||||
<li>
|
||||
<span class="field">item</span> [object | Max size: 100KB] - The item to insert.
|
||||
<span class="field">item</span> [object | Max size: 10 KB] - The item to insert.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -29,12 +29,16 @@
|
||||
|
||||
<ul>
|
||||
<li>DatabaseNotOpen</li>
|
||||
<li>DatabaseNameCannotBeBlank</li>
|
||||
<li>DatabaseNameTooLong</li>
|
||||
<li>DatabaseNameMustBeString</li>
|
||||
<li>ItemIdCannotBeBlank</li>
|
||||
<li>ItemIdTooLong</li>
|
||||
<li>ItemIdMustBeString</li>
|
||||
<li>ItemTooLarge</li>
|
||||
<li>ItemAlreadyExists</li>
|
||||
<li>AppIdNotSet</li>
|
||||
<li>AppIdNotValid</li>
|
||||
<li>ServiceUnavailable</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="section">
|
||||
<h2><a href="/docs">Docs</a> : <a href="/docs/sdk">SDK</a> : OpenDatabase</h2>
|
||||
<h2><a href="/docs/#sdk">SDK</a> : OpenDatabase</h2>
|
||||
|
||||
<p><span class="font-semibold">OpenDatabase</span> lets your retrieve data stored by the users of your web app. You also need to have a database open before storing or modify user data. This API with will return a promise that gets resolved once the database becomes available for use.</p>
|
||||
|
||||
@@ -21,11 +21,10 @@
|
||||
<span class="field">changeHandler</span> [function] - A callback that gets invoked when the database gets modified.
|
||||
<ul>
|
||||
<li>
|
||||
<span class="field">items</span> [object] - The full collection of items in the database, in insertion order.
|
||||
<span class="field">items</span> [Array] - The full collection of items in the database, in insertion order.
|
||||
<ul>
|
||||
<li><span class="field">itemId</span> [string] - The item's unique identifier.</li>
|
||||
<li><span class="field">item</span> [object] - The stored item.</li>
|
||||
<li><span class="field">creationTime</span> [Date] - The timestamp when the item was created.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -41,6 +40,7 @@
|
||||
<li>DatabaseNameMustBeString</li>
|
||||
<li>ChangeHandlerMustBeFunction</li>
|
||||
<li>AppIdNotSet</li>
|
||||
<li>AppIdNotValid</li>
|
||||
<li>ServiceUnavailable</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="section">
|
||||
<h2><a href="/docs">Docs</a> : <a href="/docs/sdk">SDK</a> : SignInWithSession</h2>
|
||||
<h2><a href="/docs/#sdk">SDK</a> : SignInWithSession</h2>
|
||||
|
||||
<p><span class="font-semibold">SignInWithSession</span> lets you automatically log in a user using the last used session. This API with will return a promise that gets resolved once the session has been validated. If the session is valid, the user gets automatically logged in.</p>
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
<span class="field">user</span> [object] - If set, this contains information about the logged in user.
|
||||
<ul>
|
||||
<li><span class="field">username</span> [string] - The user's username.</li>
|
||||
<li><span class="field">seed</span> [string] - The user's encryption key.</li>
|
||||
<li><span class="field">creationTime</span> [Date] - The timestamp when the user was created.</li>
|
||||
<li><span class="field">key</span> [string] - The user's encryption key.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><span class="field">lastUsedUsername</span> [string] - If set, this is the username of the last user that was logged in.</li>
|
||||
@@ -37,6 +36,7 @@
|
||||
|
||||
<ul>
|
||||
<li>AppIdNotSet</li>
|
||||
<li>AppIdNotValid</li>
|
||||
<li>ServiceUnavailable</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="section">
|
||||
<h2><a href="/docs">Docs</a> : <a href="/docs/sdk">SDK</a> : SignIn</h2>
|
||||
<h2><a href="/docs/#sdk">SDK</a> : SignIn</h2>
|
||||
|
||||
<p><span class="font-semibold">SignIn</span> lets your users log into your web app. This API with will return a promise that gets resolved once the user has been logged in.</p>
|
||||
|
||||
@@ -29,8 +29,7 @@
|
||||
<span class="field">user</span> [object] - Contains information about the logged in user.
|
||||
<ul>
|
||||
<li><span class="field">username</span> [string] - The user's username.</li>
|
||||
<li><span class="field">seed</span> [string] - The user's encryption key.</li>
|
||||
<li><span class="field">creationTime</span> [Date] - The timestamp when the user was created.</li>
|
||||
<li><span class="field">key</span> [string] - The user's encryption key.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -47,6 +46,7 @@
|
||||
<li>PasswordTooLong</li>
|
||||
<li>PasswordMustBeString</li>
|
||||
<li>AppIdNotSet</li>
|
||||
<li>AppIdNotValid</li>
|
||||
<li>ServiceUnavailable</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="section">
|
||||
<h2><a href="/docs">Docs</a> : <a href="/docs/sdk">SDK</a> : SignOut</h2>
|
||||
<h2><a href="/docs/#sdk">SDK</a> : SignOut</h2>
|
||||
|
||||
<p><span class="font-semibold">SignOut</span> lets your users log out of your web app. This API with will return a promise that gets resolved once the user has been logged out.</p>
|
||||
|
||||
@@ -14,7 +14,9 @@
|
||||
<h3 id="errors">Errors</h3>
|
||||
|
||||
<ul>
|
||||
<li>UserNotSignedIn</li>
|
||||
<li>AppIdNotSet</li>
|
||||
<li>AppIdNotValid</li>
|
||||
<li>ServiceUnavailable</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="section">
|
||||
<h2><a href="/docs">Docs</a> : <a href="/docs/sdk">SDK</a> : SignUp</h2>
|
||||
<h2><a href="/docs/#sdk">SDK</a> : SignUp</h2>
|
||||
|
||||
<p><span class="font-semibold">SignUp</span> lets you create user accounts for your web app. This API with will return a promise that gets resolved once the user account has been created.</p>
|
||||
|
||||
@@ -29,8 +29,7 @@
|
||||
<span class="field">user</span> [object] - Contains information about the new user.
|
||||
<ul>
|
||||
<li><span class="field">username</span> [string] - The user's username.</li>
|
||||
<li><span class="field">seed</span> [string] - The user's encryption key.</li>
|
||||
<li><span class="field">creationTime</span> [Date] - The timestamp when the user was created.</li>
|
||||
<li><span class="field">key</span> [string] - The user's encryption key.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -47,6 +46,7 @@
|
||||
<li>PasswordTooLong</li>
|
||||
<li>PasswordMustBeString</li>
|
||||
<li>AppIdNotSet</li>
|
||||
<li>AppIdNotValid</li>
|
||||
<li>ServiceUnavailable</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="section">
|
||||
<h2><a href="/docs">Docs</a> : <a href="/docs/sdk">SDK</a> : Transaction</h2>
|
||||
<h2><a href="/docs/#sdk">SDK</a> : Transaction</h2>
|
||||
|
||||
<pre>
|
||||
<code class="language-javascript">userbase.transaction(databaseName, operations)
|
||||
@@ -24,14 +24,19 @@
|
||||
|
||||
<ul>
|
||||
<li>DatabaseNotOpen</li>
|
||||
<li>DatabaseNameCannotBeBlank</li>
|
||||
<li>DatabaseNameTooLong</li>
|
||||
<li>DatabaseNameMustBeString</li>
|
||||
<li>OperationsMustBeArray</li>
|
||||
<li>ItemIdCannotBeBlank</li>
|
||||
<li>ItemIdTooLong</li>
|
||||
<li>ItemIdMustBeString</li>
|
||||
<li>ItemTooLarge</li>
|
||||
<li>ItemAlreadyExists</li>
|
||||
<li>ItemDoesNotExist</li>
|
||||
<li>UpdateConflict</li>
|
||||
<li>ItemUpdateConflict</li>
|
||||
<li>AppIdNotSet</li>
|
||||
<li>AppIdNotValid</li>
|
||||
<li>ServiceUnavailable</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<div class="section">
|
||||
<h2><a href="/docs">Docs</a> : <a href="/docs/sdk">SDK</a> : Update</h2>
|
||||
<h2><a href="/docs/#sdk">SDK</a> : Update</h2>
|
||||
|
||||
<p><span class="font-semibold">Update</span> lets your modify an existing item in a user's database. This API with will return a promise that gets resolved once the item has been durably updated into the database.</p>
|
||||
|
||||
<pre>
|
||||
<code class="language-javascript">userbase.update(databaseName, itemId, item)
|
||||
<code class="language-javascript">userbase.update(databaseName, item, itemId)
|
||||
.then(() => {
|
||||
// item updated
|
||||
})
|
||||
@@ -21,7 +21,7 @@
|
||||
<span class="field">itemId</span> [string | Len: 1-100] - The unique identifier of the item to replace.
|
||||
</li>
|
||||
<li>
|
||||
<span class="field">item</span> [object | Max size: 100KB] - The object to overwrite the existing item with.
|
||||
<span class="field">item</span> [object | Max size: 10 KB] - The object to overwrite the existing item with.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -29,12 +29,16 @@
|
||||
|
||||
<ul>
|
||||
<li>DatabaseNotOpen</li>
|
||||
<li>DatabaseNameCannotBeBlank</li>
|
||||
<li>DatabaseNameTooLong</li>
|
||||
<li>DatabaseNameMustBeString</li>
|
||||
<li>ItemIdCannotBeBlank</li>
|
||||
<li>ItemIdMustBeString</li>
|
||||
<li>ItemTooLarge</li>
|
||||
<li>ItemDoesNotExist</li>
|
||||
<li>UpdateConflict</li>
|
||||
<li>ItemUpdateConflict</li>
|
||||
<li>AppIdNotSet</li>
|
||||
<li>AppIdNotValid</li>
|
||||
<li>ServiceUnavailable</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -110,4 +110,9 @@ ul {
|
||||
@apply font-semibold
|
||||
}
|
||||
|
||||
a.anchor {
|
||||
@apply block relative;
|
||||
top: -50px;
|
||||
}
|
||||
|
||||
@tailwind utilities;
|
||||
|
||||
Reference in New Issue
Block a user