Skip to main content
Version: 0.11

BaseContext

@devvit/public-api v0.11.19-dev


Type Alias: BaseContext

BaseContext = object

Properties

appAccountId

appAccountId: string

The ID of the current app's account

Deprecated

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


appName

appName: 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


postData?

optional postData: PostData


postId?

optional postId: string

The ID of the current post


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

Methods

toJSON()

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

Returns a JSON representation of the context

Returns

Omit<BaseContext, "toJSON">