We have updated our Data Processing Addendum, for more information – Click here.

const jwt = require("jsonwebtoken");

const config = process.env;

const verifyToken = (req, res, next) => {
  const token =
    req.body.token || req.query.token || req.headers["x-access-token"];

  if (!token) {
    return res.status(403).send("A token is required for authentication");
  }

  try {
    req.user = jwt.verify(token, config.TOKEN_KEY);
  } catch (err) {
    return res.status(401).send("Invalid Token");
  }

  return next();
};

module.exports = verifyToken;

How Imperfect Foods Expanded Their Revenue With Experimentation

Imperfect Foods uses Split to take an experiment-driven approach to their product development. The team also uses feature flags to make fast changes to their website and dynamic configurations to make changes without requiring any code pushes or deploys. With this approach, Imperfect Foods has seen weekly order volumes double over the past 6 months.

About Imperfect Foods

Imperfect Foods uses Split to take an experiment-driven approach to their product development. The team also uses feature flags to make fast changes to their website and dynamic configurations to make changes without requiring any code pushes or deploys. With... Read more

USE CASES

Controlled Rollout, Feature Experimentation, Feature Flags

Imperfect Foods is an online grocery delivery company whose mission is to eliminate food waste and build a better food system. Throughout the food supply chain, surplus is generated or products are rejected due to cosmetic imperfections. Instead of throwing that surplus away, Imperfect Foods rescues it and sells it to create a world of zero waste.

Salmon is a great example: the company repackages 3-5oz cuts that don’t meet the strict size and shape demands from restaurants but are perfect for home cooks. When the travel industry experienced a sharp decline, Imperfect scooped up 16,000 cheese trays from airlines to add an unexpected snack to the usual grocery shopping.

Customers sign up for Imperfect Foods through a weekly subscription. Via Imperfect’s website, customers can review their suggested order, add or remove items, and then Imperfect Foods delivers the groceries directly to their door. Imperfect Foods relies on talented product and engineering teams to keep all of the food flowing to customers, while targeting zero waste.

Benefiting From a Culture of Experimentation

Patti Chan, VP Product at Imperfect Foods, wanted to take an experiment-driven approach to product development. Originally, they tried to create their own feature flagging system but weren’t getting as much value out of it as they hoped.

“Split allowed us to establish an “experiment-driven process” without having to invest the time to build out an extensive framework ourselves.”

Patti Chan, VP Product

Although Imperfect Foods’ development team is small, their impact is huge. They utilized Split’s integration with Segment to power experimentation across user flows on their site. Shortly after Imperfect expanded from produce to full grocery, the team tested a new feature to introduce grocery add-on subscriptions during signup. In addition to the starter produce box, customers could opt into receiving meats, grains, dairy, or even snacks. This feature made it even more convenient for customers to take advantage of the expanded product assortment, helping weekly order volumes to double since January. Tying back to its mission, Imperfect Foods is on track to save more than 200 million pounds of food from going to waste in 2020.

The Safety To Take Bold Bets

In another experiment, Patti notes her team “had a hypothesis that making some key changes to our subscription options during signup could radically increase the value we bring to our customers. With any new feature, there’s so many different ways to present the idea to your users. We tested a subtle version, a traditional version, and one risky version that we thought was very compelling but could add up to a minute in the signup process.”

“Thanks to Split, we were able to learn that the risky version actually had the highest adoption by our customers while keeping overall signup conversion steady.”

Patti Chan, VP Product

Moving Faster in a Time of Crisis

In early 2020, when COVID-19 drove most of North America into their homes and curtailed nearly all public activity, Imperfect Foods recognized a dramatic increase in the demand for their online grocery service that delivered fresh food to customers’ doorsteps. They were able to respond by increasing their volume to meet this demand, and still had interested customers growing their waitlist through spring. During this high-volume period, Imperfect Foods hired over a hundred extra workers and offered existing employees more shifts to accommodate the larger scale.

Shipping Features With Speed and Efficiency

Imperfect Foods also started using feature flags to make fast changes to their website. In one instance, the unprecedented spike in demand had led to a major delay in one region. Thanks to building an alert banner powered by dynamic configurations, the team was able to quickly show a message to just the affected customers without requiring any code pushes or deploys. Even non-technical product managers could make these feature changes, while engineers stayed focused on building tools to scale the business. This process not only increased developer velocity but drastically reduced the number of calls that their customer care team received.

“Using Split enabled us to create the culture we wanted.”

As Imperfect Foods continues to innovate in the grocery industry, Split is working with them to make sure they have the infrastructure and tooling they need to test and scale. Patti and her team are dedicated to experimentation-driven product development, and Split makes that possible.

Switch It On With Split

The Split Feature Data Platform™ gives you the confidence to move fast without breaking things. Set up feature flags and safely deploy to production, controlling who sees which features and when. Connect every flag to contextual data, so you can know if your features are making things better or worse and act without hesitation. Effortlessly conduct feature experiments like A/B tests without slowing down. Whether you’re looking to increase your releases, to decrease your MTTR, or to ignite your dev team without burning them out–Split is both a feature management platform and partnership to revolutionize the way the work gets done. Schedule a demo to learn more.

Get Split Certified

Split Arcade includes product explainer videos, clickable product tutorials, manipulatable code examples, and interactive challenges.

Want to Dive Deeper?

We have a lot to explore that can help you understand feature flags. Learn more about benefits, use cases, and real world applications that you can try.

Create Impact With Everything You Build

We’re excited to accompany you on your journey as you build faster, release safer, and launch impactful products.