ABSTRACT Initial drug use promotes the development of conditioned reinforcement, whereby the reinforcing properties of a drug become attributed to drug-associated stimuli, such as cues and contexts. A principal role for the nucleus accumbens (NAc) in the response to drug-associated stimuli has been well-documented. In particular, direct and indirect pathway medium spiny neurons (dMSNs and iMSNs) have been shown to bidirectionally regulate cue-induced heroin-seeking in rats expressing addiction-like phenotypes, and a shift in NAc activity towards the direct pathway has been shown in mice following cocaine conditioned place preference (CPP). However, how NAc signaling guides heroin CPP, and whether heroin alters the balance of signaling between dMSNs and iMSNs remains unknown. Moreover, the role of NAc dopamine signaling in heroin reinforcement remains unclear. Here, we integrate fiber photometry for in vivo monitoring of dopamine and dMSN/iMSN calcium activity with a heroin CPP procedure in rats to address these outstanding questions. We identify a sensitization-like response to heroin in the NAc, with prominent iMSN activity during initial heroin exposure and prominent dMSN activity following repeated heroin exposure. We demonstrate a ramp in dopamine activity, dMSN activation, and iMSN inactivation preceding entry into a heroin-paired context, and a decrease in dopamine activity, dMSN inactivation, and iMSN activation preceding exit from a heroin-paired context. Finally, we show that buprenorphine is sufficient to prevent the development of heroin CPP and activation of the NAc post-conditioning. Together, these data support the hypothesis that an imbalance in NAc activity contributes to the development of addiction. SIGNIFICANCE STATEMENT The attribution of the reinforcing effects of drugs to neutral stimuli (e.g., cues and contexts) contributes to the maintenance of addiction, as re-exposure to drug-associated stimuli can reinstate drug seeking and taking even after long periods of abstinence. The nucleus accumbens (NAc) has an established role in encoding the value of drug-associated stimuli, and dopamine release into the NAc is known to modulate the reinforcing effects of drugs, including heroin. Using fiber photometry, we show that entering a heroin-paired context is driven by dopamine signaling and NAc direct pathway activation, whereas exiting a heroin-paired context is driven by NAc indirect pathway activation. This study provides further insight into the role of NAc microcircuitry in encoding the reinforcing properties of heroin.