SEATTLE >> Need Plan B? Tap your credit card and enter B6.

Since last November, a library at the University of Washington has featured a different kind of vending machine, one that’s become more popular on campuses around the country since the U.S. Supreme Court ended constitutional protections for abortion last year. It’s stocked with ibuprofen, pregnancy tests and the morning-after pill.

With some states enacting abortion bans and others enshrining protections and expanding access to birth control, the machines are part of a push on college campuses to ensure emergency contraceptives are cheap, discreet and widely available.

There are now 39 universities in 17 states with emergency contraceptive vending machines, and at least 20 more considering them, according to the American Society for Emergency Contraception. Some, such as the University of Tulsa in Oklahoma, are in states where abortion is largely banned.

Over-the-counter purchase of Plan B and generic forms is legal in all 50 states.

The 2022 ruling overturning Roe v. Wade “is putting people’s lives at stake, so it makes pregnancy prevention all the more urgent,” said Kelly Cleland, the ASEC’s executive director. “If you live in a state where you cannot get an abortion and you can’t get an abortion anywhere near you, the stakes are so much higher than they’ve ever been before.”

Washington this year became first U.S. state to set aside money — $200,000 to fund $10,000 grants that colleges can obtain next year through an application process — to expand access to emergency contraceptives at public universities and technical colleges through the automatic dispensers.

The University of Washington’s machine was installed after a student-led campaign. It offers boxes of generic Plan B for $12.60, about a quarter of what the name-brand versions sell for in stores, and more than 640 have been sold.

The drug is even cheaper in some machines than it is in UW’s, as low as $7 per box. That’s because it is sold at just above wholesale cost, compared with pharmacy retail prices that might go up to $50.

In Illinois and New York, lawmakers are developing legislation that would require at least one vending machine selling emergency contraceptives on state college campuses.