Skip to content

Releases: neg4n/next-api-og-image

Ability to set custom chrome options

21 Sep 09:17
2a9769d
Compare
Choose a tag to compare

What's Changed

  • Ability to set custom chrome options by @neg4n in #46

Explanation

This release is kinda continuation of https://github.com/neg4n/next-api-og-image/releases/tag/4.2.2, in other words - next-api-og-image development heading towards start being able to be hosted on VPS or dedicated servers or any other non-serverless environment. This time we introduce option to set custom chrome parameters directly in next-api-og-image options object!

New properties

// NOTE: Options within 'chrome' object only works when next-api-og-image is run in server (not serverless!!) environment.
chrome: {
  // Custom command-line args passed to the browser start command
  // by default, no arguments are provided.
  args: null
  // Custom executable provided. Useful when you e.g. have to run Chromium instead of Google Chrome
  // by default, executable is retrieved automatically (it looks for Google Chrome in the filesystem)
  executable: null,
}

Acknowledgements

Thanks to @vanniewelt and @njoguamos for contributing to the project ❤️

Full Changelog: 4.2.2...4.3.0

Add dynamic chrome options for lambda & non lambda

13 Sep 22:41
1e579a5
Compare
Choose a tag to compare

What's Changed

  • Add dynamic chrome options for lambda & non lambda by @neg4n in #42

Explanation

The next-api-og-image library was intended to be used only in cloud environments at the beginning. That is why it was not designed with mind of support for hosting on VPS / Dedicated servers. Recently, the #40 issue came up to the open and this was a opportunity to add support both server and serverless environments

From now on, the next-api-og-image should work out of the box both on server (with chrome installed) and serverless environments. This also means that testing the application using next-api-og-image locally with NODE_ENV set to production will no longer throw an error regarding chrome 🚀

Acknowledgements

Thanks to @guhyeon, @mvandergrift and @kamenskiyyyy for contributing to the issue development 🤗

Full Changelog: 4.2.1...4.2.2

Fix chrome path on Windows 64bit

29 Jul 09:46
936fb2f
Compare
Choose a tag to compare

From now on issues related to invalid chrome executable path (while on local development environment) should not happen 😄

Full Changelog: 4.2.0...4.2.1

Ability to set custom headers

26 Jul 05:01
fe8dbdf
Compare
Choose a tag to compare

Added return value to hook function passed in configuration object. From now on, this function can return Map containing custom headers that will be set before sending response with open-graph image to client.

Example code:

import { withOGImage } from 'next-api-og-image'

export default withOGImage({
  template: {
    react: ({ myQueryParam }) => <div>🔥 {myQueryParam}</div>,
  },
  hook: () => {
    const headers = new Map()
    headers.set('X-My-Header', 'cool-thing')
    return headers
  },
})

Full Changelog: 4.1.0...4.2.0

Hook function

11 Jul 00:54
58e72bb
Compare
Choose a tag to compare

What's Changed

Full Changelog: 4.0.1...4.1.0

Move chrome-aws-lambda to peerDependencies

11 Apr 02:13
7bdcfa5
Compare
Choose a tag to compare

BREAKING CHANGE: From now on, next-api-og-image has chrome-aws-lambda in peerDependencies... but what does it mean?

When installing next-api-og-image >= 4.0.0 you also have to install appropriate chrome-aws-lambda version.

In most cases, the

npm i next-api-og-image chrome-aws-lambda
# or
yarn add next-api-og-image chrome-aws-lambda

will be sufficient.

But when you'll encounter serverless function size exceed limit on Vercel:

npm i next-api-og-image [email protected]
# or
yarn add next-api-og-image [email protected]

The 6.0.0 version of chrome-aws-lambda is smaller than the latest one (10.1.0 at the time of writing this release notes)

Acknowledgements

Gargantuan thanks to @transitive-bullshit for making research on this 🙏🏻

Full Changelog: 3.0.0...4.0.1

Configurable image type and quality

06 Apr 04:08
bcfe8e7
Compare
Choose a tag to compare

BREAKING CHANGE:

Removed contentType option in next-api-og-image configuration object. From now on, the type property is its successor. Available values for it are: png, webp, jpeg.

If type is set to jpeg (works only for this particular type!!), the quality option can be set. If the type will be different than jpeg, the quality option will simply do nothing.

Full Changelog: 2.2.1...3.0.0

Image file types and ability to adjust the quality

05 Apr 20:47
b9a4e84
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 2.2.0...2.2.1

Width and height options

05 Apr 19:19
010c0db
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 2.1.1...2.2.0

2.1.1

28 Oct 20:14
9e9619b
Compare
Choose a tag to compare
  • Fix critical bug that leaded to error informing about invalid chromium executable in serverless environment. (it was related to invalid detection of process.env.NODE_END)
  • Fix lack of presence of errorsInResponse in query strategy checks
  • Remove throw if strategy is set to query and its empty. This was not an error behaviour.