Skip to main content

Meteor Core API

The Core Meteor API provides the fundamental building blocks for creating reactive, real-time applications. This includes core methods, reactivity, and essential utilities.

Meteor Namespace

The global Meteor namespace contains all core functionality available on both client and server.

Meteor.isClient

boolean
Boolean variable that is true if running in a client environment.

Meteor.isServer

boolean
Boolean variable that is true if running in a server environment.

Meteor.startup()

function
required
A function to run on startup.
Run code when the client or server starts.

Meteor.wrapAsync()

Wrap an asynchronous function to run synchronously using fibers.
function
required
An asynchronous function to wrap.
object
Optional this context for the function.

Meteor.defer()

Defer execution of a function to run asynchronously after the current method finishes.
function
required
The function to defer.

Meteor.absoluteUrl()

Generate an absolute URL pointing to the application.
string
A path to append to the root URL.
object
Options object.
boolean
Create an HTTPS URL.
string
Replace localhost with this hostname.
string
Override the default ROOT_URL.

Meteor.settings

object
Contains deployment-specific configuration. Settings are loaded from a JSON file specified with --settings.

Meteor.release

string
The name of the Meteor release with which the project was built, for example "METEOR@1.2.3".

Environment Variables

ROOT_URL

Set the root URL for the application.

MONGO_URL

Specify the MongoDB connection string.

PORT

Set the port on which the application listens.

Development Utilities

Meteor._debug()

Log a message with Meteor’s logging system. Uses console.error on the client.

Meteor.Error

Create a Meteor-specific error.
string|number
required
A numeric error code or string error type.
string
Optional description of the error.
string
Optional additional details.