{"library":"parse-server-sendgrid-adapter","title":"Parse Server SendGrid Adapter","description":"This package provides a straightforward email adapter for Parse Server, enabling it to send emails via SendGrid's API. It allows Parse Server applications to handle functionalities like user verification and password resets using SendGrid's robust email delivery service. Currently at version 1.0.0, the package appears to be stable and provides a simple integration point for SendGrid. Its primary differentiator is its direct, minimal integration specifically for Parse Server's `emailAdapter` configuration, avoiding more complex or generic email solutions when SendGrid is the chosen provider. Release cadence is likely slow, focusing on stability given its mature 1.0.0 version and niche purpose. It aims to simplify SendGrid setup within a Parse Server environment.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install parse-server-sendgrid-adapter"],"cli":null},"imports":["import SimpleSendGridAdapter from 'parse-server-sendgrid-adapter';","const SimpleSendGridAdapter = require('parse-server-sendgrid-adapter');","import { ParseServer } from 'parse-server';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import express from 'express';\nimport { ParseServer } from 'parse-server';\nimport SimpleSendGridAdapter from 'parse-server-sendgrid-adapter';\n\nconst app = express();\n\n// Load sensitive configurations from environment variables\nconst databaseURI = process.env.DATABASE_URI || 'mongodb://localhost:27017/dev';\nconst cloudCodePath = process.env.CLOUD_CODE_PATH || './cloud/main.js'; // Ensure this is an absolute path in production\nconst appId = process.env.PARSE_APP_ID || 'myAppId';\nconst masterKey = process.env.PARSE_MASTER_KEY || 'myMasterKey'; // KEEP THIS SECRET!\nconst serverURL = process.env.PARSE_SERVER_URL || 'http://localhost:1337/parse';\nconst publicServerURL = process.env.PARSE_PUBLIC_SERVER_URL || serverURL;\nconst sendgridApiKey = process.env.SENDGRID_API_KEY || 'YOUR_SENDGRID_API_KEY';\nconst fromEmailAddress = process.env.SENDGRID_FROM_EMAIL || 'no-reply@example.com';\n\nconst api = new ParseServer({\n  databaseURI: databaseURI,\n  cloud: cloudCodePath,\n  appId: appId,\n  masterKey: masterKey,\n  serverURL: serverURL,\n  appName: 'myAppName',\n  publicServerURL: publicServerURL,\n  emailAdapter: SimpleSendGridAdapter({\n    apiKey: sendgridApiKey,\n    fromAddress: fromEmailAddress,\n  }),\n});\n\n// Serve the Parse API on the /parse URL prefix\napp.use('/parse', api);\n\nconst port = process.env.PORT || 1337;\napp.listen(port, function() {\n  console.log(`Parse Server running on port ${port}.`);\n  console.log(`Access at ${publicServerURL}`);\n});\n","lang":"javascript","description":"This quickstart demonstrates how to integrate `parse-server-sendgrid-adapter` into a basic Parse Server setup using Express. It configures the `emailAdapter` to use SendGrid, emphasizing the importance of environment variables for API keys and other sensitive data.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}