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

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

Meteor.isServer

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

Meteor.startup()

func
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.
func
function
required
An asynchronous function to wrap.
context
object
Optional this context for the function.

Meteor.defer()

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

Meteor.absoluteUrl()

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

Meteor.settings

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

Meteor.release

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.
error
string|number
required
A numeric error code or string error type.
reason
string
Optional description of the error.
details
string
Optional additional details.