HACKENSACK, N.J. (AP) _ Although her legal name and who will raise her remain undecided, one thing is certain about the future for Baby M - the strife and notoriety that marked her first 12 months will follow her throughout her life.

The baby, born March 27, 1986, to a woman inseminated with the sperm of a man whose wife chose to avoid pregnancy for medical reasons, has lived at the center of a maelstrom of pain, anger and fear.

The child - called Sara by her mother, Melissa by her father, Baby M by the court - appears unaffected by the uproar surrounding her life, according to mental health experts who have observed her.

''Baby M is a serene, comfortable, resilient, inquisitive, interactive child,'' said psychiatrist Marshall A. Schechter, an expert witness in the trial. The girl ''demonstrates a bouyancy and a sunniness of spirit that was a delight to see,'' he added.

But most experts agree that coping with her unique beginnings will inevitably mark the child's early years.

Mary Beth Whitehead, who agreed under contract to bear a child for William Stern, was to have relinquished her parental rights and given the baby to Stern and his wife, Elizabeth, who then would have adopted her.

But Mrs. Whitehead said she had a change of heart while giving birth. When she told the Sterns she was struggling with the loss of her child, they gave Baby M back to her on the understanding it was temporary.

When Mrs. Whitehead refused to voluntarily return the infant, the Sterns obtained a court order. But Mrs. Whitehead fled with her family and Baby M to relatives in Florida, eluding police at her home by passing the baby through a window to her husband outside.

Baby M lived for 87 days in Florida with the Whiteheads, who moved from one relative to another, Mrs. Whitehead has testified.

After authorities caught up with the family, the child was put in temporary custody of the Sterns. Mrs. Whitehead has been allowed twice-weekly, two-hour visits.

Mental health workers have said the child appears most attached to Stern and shows no anxiety about being separated from Mrs. Whitehead.

''In the midst of this dispute, one fact about which both families seem to agree is that Sara-Melissa is a happy, alert, resilient baby,'' wrote clinical social worker Judith B. Greif.