Back to reference

EditorConfig

Configuration to customize the Grammarly integration per editor instance.

interface EditorConfig {
  autocomplete?: "on" | "off";
  documentDialect?: Dialect;
  documentDomain?: Domain;
  introText?: string;
  oauthRedirectUri?: string;
  suggestionCards?: "on" | "off";
  suggestionCategories?: SuggestionCategories;
  toneDetector?: "on" | "off";
  underlines?: "on" | "off";
  userFeedback?: "on" | "off";
  collectUserFeedback?: boolean;
  document?: DocumentConfig;
  oauth?: OAuthConfig;
  onPluginDisable?: (reason: PluginDisableReason) => void;
  onPluginError?: (error: Error) => void;
  onTextStats?: (stats: TextStats) => void;
  showToneDetector?: boolean;
  suggestions?: SuggestionCategoriesDeprecated;
  ui?: UIConfig;
}

Properties

autocomplete optional"on" | "off"
Offer to complete phrases for your users as they type. Learn moreopen in new window

Autocomplete is not currently supported for <input> fields.

If you have a Content Security Policy (CSP), you will need to update it as described hereopen in new window.

Try it outopen in new window
Default: "off"
Since: v1.7.0

documentDialect optionalDialect
Which English dialect should be assumed?

Try it outopen in new window
Default: "auto-text"
Since: v1.6.3

documentDomain optionalDomain
What is the style or type of writing?

Try it outopen in new window
Default: "general"
Since: v1.6.3

introText optionalstring
Text shown to introduce first-time users to Grammarly.

This introductory text shows in the footer of suggestion cards until the user first accepts or dismisses a suggestion.

Try it outopen in new window
Default: "Grammarly helps you write clearly and mistake-free."
Since: v1.6.3

oauthAssertionProvider experimental optionalstring | (() => Promise<{ assertion: string; }>)
OAuth assertion to verify ownership of the clientId.
Since: v1.10.2

oauthRedirectUri optionalstring
URI to redirect to after successful account connection.
Since: v1.6.3

suggestionCards optional"on" | "off"
Show suggestion cards when a user hovers over a suggestion underline.
Default: "on"
Since: v1.9.0

suggestionCategories optionalSuggestionCategories
Categories of suggestions that can be muted.

Try it outopen in new window

toneDetector optional"on" | "off"
Show the tone detector interface (beside the Grammarly button).

Note that tone detection requires a text of at least 150 characters.
Default: "off"
Since: v1.8.3

underlines optional"on" | "off"
Show underlines for suggestions.
Default: "on"
Since: v1.9.2

userFeedback optional"on" | "off"
Collect user feedback after the user takes action on 5 suggestions.

We will not request feedback more than once in a 30 day period.
Default: "on"
Since: v1.8.3

collectUserFeedback deprecated optionalboolean
Collect user feedback after the user takes action on 5 suggestions.

We will not request feedback more than once in a 30 day period.
Default: true
Deprecated: since v1.8.3 - Use userFeedback

document deprecated optionalDocumentConfig
Context of the input document that informs Grammarly suggestions.
Deprecated: since v1.6.7

oauth deprecated optionalOAuthConfig
Configuration for connected accounts.
Deprecated: since v1.6.7

onPluginDisable deprecated optional(reason: PluginDisableReason) => void
Triggered when the user consciously disables the plugin. Not triggered again once already disabled.
Deprecated: since v1.9.0 - use plugin-turned-off event

onPluginError deprecated optional(error: Error) => void
Callback triggered on fatal error with the plugin.
Deprecated: since v1.9.0 - use plugin-error event

onTextStats deprecated optional(stats: TextStats) => void
Callback to receive stats about the user-entered text and Grammarly session.
Deprecated: since v1.9.0 - use document-stats or session-stats events instead.

showToneDetector deprecated optionalboolean
Show the tone detector interface (beside the Grammarly button).

Note that tone detection requires a text of at least 150 characters.
Default: false
Deprecated: since v1.8.3 - Use toneDetector

suggestions deprecated optionalSuggestionCategoriesDeprecated
Categories of suggestions that can be muted.

Try it outopen in new window
Deprecated: since v1.9.2 - use suggestionCategories instead

ui deprecated optionalUIConfig
Configuration for the user interface of Grammarly.
Deprecated: since v1.6.7

Last Updated: 4/12/2023, 3:24:55 PM