Skip to main content

BaseContext

@devvit/public-api v0.13.10-dev


Type Alias: BaseContext

BaseContext = object

Properties

appAccountId

appAccountId: string

The ID of the current app's account

Deprecated

Use BaseContext.appSlug instead to get the app's username


appName

appName: string

The slug of the app that is running

Deprecated

Use BaseContext.appSlug instead.


appSlug

appSlug: string

The slug of the app that is running


appVersion

appVersion: string

The version of the app that is running


commentId?

optional commentId: string

The ID of the current comment


debug

debug: ContextDebugInfo

More useful things, but probably not for the average developer


loid?

optional loid: string

Experimental

LOID (logged-out ID) is a token assigned on first visit and persists across sessions, account creation, and sign-in. Logged-in users retain a LOID for attribution, analytics, and cross-session tracking.


metadata

metadata: Metadata

Request headers.


postData

postData: PostData | undefined


postId?

optional postId: string

The ID of the current post


snoovatar?

optional snoovatar: string

Experimental

The current user's snoovtar URL if logged in


subredditId

subredditId: string

The ID of the current subreddit


subredditName?

optional subredditName: string

The name of the current subreddit


userId?

optional userId: string

The current user's ID if this event was triggered by a logged in user


username?

optional username: string

Experimental

The current user's handle if logged in

Methods

toJSON()

toJSON(): Omit<BaseContext, "toJSON">

Returns a JSON representation of the context

Returns

Omit<BaseContext, "toJSON">