Realtime Cloud Storage

create

StorageRef create(Object args, [function(StorageRef storageRef) success], [function(String message) error])

Creates a new Storage reference.

Sample

// Create a storage reference.
var storageRef = Realtime.Storage.create({
	applicationKey: "myApplicationKey",
	authenticationToken: "myAuthenticationToken"
});

Parameters

Object args

Structure with the necessary arguments to create a storage reference.

Properties

String applicationKey

Public key of the application's license.

String authenticationToken

An authenticated token.

Boolean isSecure optional

Defines if the requests and notifications are under a secure connection. Defaults to true.

Boolean isCluster optional

Defines if the specified url is from a cluster server. Defaults to true.

String url optional

The url of the storage server. Defaults to "storage.realtime.co".

function() onReconnect optional

Function to run every time the notification system recovers from a disconnect.

function() onReconnecting optional

Function to run every time the notification system tries to reconnect.

function(StorageRef storageRef) success optional

Response from the server when the request was completed successfully.

Arguments

StorageRef storageRef

The resulting storage reference from the executed operation.

function(String message) error optional

Response if client side validation failed or if an error was returned from the server.

Arguments

String message

The message detailing the error.